一个`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
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.1.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lzhbrowser-0.1.1.tar.gz.
File metadata
- Download URL: lzhbrowser-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc8a3c2c9cafd0d1c020b66aab13f6d41d1d947fa44d22724a9550bb18db773
|
|
| MD5 |
20b77b960ce07bdcb14b2e81882f5a5a
|
|
| BLAKE2b-256 |
68fd7e4885c26adf78560eebceecb6efa5f142c0d3528289ffdae55e937af22d
|
File details
Details for the file lzhbrowser-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lzhbrowser-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d919ee9fec9e31d855a505c1af1d8707d90b8fab0bc96a5a7d4e7e4f25f4978
|
|
| MD5 |
0d5573539635432b93f201209da3575f
|
|
| BLAKE2b-256 |
e39ee007bf379739e4f2c23a64c2d3a307c7b8401ed6d629c2ea12e9d4e2580e
|