Pre-release
This release is a pre-release and may not be stable for production use.
browser-toolkit
Browser Toolkit that provides a single inteface to interact with different browser automations.
Supported automations include:
- Selenium
- Playwright
- Camoufox (Via Playwright implementation)
- Pydoll
Features that currently browser-toolkit can offer:
- Async First
- More legible automation code
- Abstractions of browsers methods
- Helpful tools to use when interacting with browsers
Install
# Pip
pip install browser-toolkit
# Uv
uv add browser-toolkit
# Poetry
poetry add browser-toolkit
Basic
from playwright.async_api import async_playwright
from browser_toolkit.playwright import PlaywrightTollKit
import asyncio
async def main():
# Create an instance
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
# Pass instance to BrowserToolKit
btk = PlaywrightTollKit(browser=browser, page=page)
# Navigate to a website
await btk.goto('https://www.example.com')
# Create a selector
se_class = '.class1'
# Use BrowserToolKit to find a web element
web_element = await btk.selector(selector=se_class)
# With returned web_element use click() method
await web_element.click()
# Or you can click directly with BrowserToolKit
await btk.click(selector=se_class)
# close instance with BrowserToolKit
await btk.close()
if __name__ == "__main__":
asyncio.run(main())
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
browser_toolkit-0.0.1a3.tar.gz
(20.5 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 browser_toolkit-0.0.1a3.tar.gz.
File metadata
- Download URL: browser_toolkit-0.0.1a3.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f34017921641b4d16eca8395f21e357358967203773b13d75fa5b337c26d6819
|
|
| MD5 |
9e2e0a3f1a49e6e5c5a04b0400f59644
|
|
| BLAKE2b-256 |
b4a1bf8d60a629c718284bd6bc60ef7e342a7548cc5bcc284cc474bca732bf00
|
File details
Details for the file browser_toolkit-0.0.1a3-py3-none-any.whl.
File metadata
- Download URL: browser_toolkit-0.0.1a3-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01dc92337e34cf75747a4afbb147e1e75768d911f0e7d515e19ffb6942270732
|
|
| MD5 |
1205a60871da08f267c766f652290687
|
|
| BLAKE2b-256 |
4047ea91caf168e65b72b089e2c18c2ae2dc176e6e481b55bff30c18c52485f1
|