Skip to main content

web helper

Project description

说明

pyweb助手,封装一些个人常用类函数

win系统控制隐藏web窗口,需安装pywin32

试一试 浏览器

from easy_pyweb.wb_helpers import WebHelper

def open_page():
    wb = WebHelper(cookie_path='cookies.txt')
    page = wb.new_page()
    page.goto('https://tool.lu/timestamp/')
    print(page.title())
    print('高度%s' % page.get_height())
    value = page.locator('#jsDatetimeO').input_value()
    print('时间%s' % value)
    page.slide_bottom()
    assert page.title() == '时间戳(Unix timestamp)转换工具 - 在线工具'

试一试 日志,配置类

from easy_pyweb.more_tool import SingletonLogger, ConfigParser
def log_test():
    logger = SingletonLogger(logdir='logs').get_logger()
    logger.info('This is a test log')
    logger.error('This is a error log')

def conf_test():
    conf = ConfigParser(config_file='config.ini')
    conf.init_config()
    print(conf.get_option('TEST', 'user'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_pyweb-1.2.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_pyweb-1.2-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file easy_pyweb-1.2.tar.gz.

File metadata

  • Download URL: easy_pyweb-1.2.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for easy_pyweb-1.2.tar.gz
Algorithm Hash digest
SHA256 37fdcad7c02fc76ea01781d9cc757268942d567ff3a0e93c9a6c6a2cdaffe186
MD5 ef8bfad062d9e0ff34968afd8204d438
BLAKE2b-256 615355f98602491436ea3eaca60fc4eb44d29a0e14616f93b326dd20207aa25d

See more details on using hashes here.

File details

Details for the file easy_pyweb-1.2-py3-none-any.whl.

File metadata

  • Download URL: easy_pyweb-1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for easy_pyweb-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89289bcd6d056a46066e7c7be8de7c1931b1de410e98c8f449c3804c27a0876e
MD5 32525915008eb701582aa77cb77d3316
BLAKE2b-256 cceef85f09d8b34f75f8567469c109f648fc973718ba58314ffc35d5583b23bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page