Skip to main content

web helper

Project description

说明

  • pyweb助手,封装一些个人常用类函数
  • 内置【playwright浏览器类,logger,mysql,config】
  • win系统控制隐藏web窗口,需安装pywin32

安装使用

pip install easy-pyweb

试一试 浏览器

from easy_pyweb.wb_helpers import WebHelper

def open_page():
    wb = WebHelper(use_async=False)
    wb.init_browser_sync()
    page = wb.new_page_sync()
    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.3.tar.gz (22.8 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.3-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for easy_pyweb-1.3.tar.gz
Algorithm Hash digest
SHA256 47a4b3c27d47eb154bea374f7570d004f28cbd71b9d60537b258e0aed6385030
MD5 fb2f50d49b619216b790a8945252add7
BLAKE2b-256 32680059fda1c5fefebe7e2510a97f30154689d4048e048ef63951169244cb29

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for easy_pyweb-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f812ec4e297d204dacfb84f7a58c33d757626f9902c902e076c03dba2e9a27b9
MD5 ec588e315225a1f0e34afa53e850f977
BLAKE2b-256 4c10371524f0114079acb95395f3632c95ddd0ebdfe1b7f7e2de8f5b728a0fa4

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