Skip to main content

一个`playwright`实例,支持`cookie`、自动代理(白名单)、远程调试、设定加载内容

Project description

browser

一个playwright实例,支持cookie、自动代理(白名单)、远程调试、设定加载内容

示例

from lzhbrowser import Browser
import asyncio

async def main():
    browser = await Browser.create(
        headless=False,
        proxy= {"server": "socks5://127.0.0.1:1080"},
        logging_level=logging.DEBUG)
    white_list:set[str] = {
        "*.dmm.com",
        "*.dmm.co.jp",
        "www.prestige-av.com",
        "www.mgstage.com"
    }
    browser.white_list_update(white_list)
    content = await browser.fetch("https://video.dmm.co.jp/")
    content2 = await browser.fetch("https://www.google.com")
    await asyncio.sleep(10)
    await browser.close()
asyncio.run(main())

安装 - PyPI

pip install lzhbrowser

API

Document

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

lzhbrowser-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

lzhbrowser-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file lzhbrowser-0.1.0.tar.gz.

File metadata

  • Download URL: lzhbrowser-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lzhbrowser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d35d19a7ff73215a9fc532d9ea470438cab47a9c3c42151ee1f473f72a6909c
MD5 3865e06fb5fa63c59fbc08641c36ae9f
BLAKE2b-256 350f74af08c73d72830ac7369791a1ae5758902477a687c8ea462853e21ec03f

See more details on using hashes here.

File details

Details for the file lzhbrowser-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lzhbrowser-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lzhbrowser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11b3bf8c32b73ea3b98ad6242f6182b13d1aee63d07f7098c551f76a97e40307
MD5 cb45513b1109652e23e31da0134db368
BLAKE2b-256 828e9d92758fc0779ea6183a80ad2ed22cf3af58b13af11751229e5f09deccc8

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