Toolkit that provides a single inteface to interact with different browser automations.
Project description
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())
Project details
Release history Release notifications | RSS feed
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.1a2.tar.gz
(19.2 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.1a2.tar.gz.
File metadata
- Download URL: browser_toolkit-0.0.1a2.tar.gz
- Upload date:
- Size: 19.2 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 |
3a76985dfe5324291b2dc7b919df6d748997345a32c5dd9e31565d3a6a303094
|
|
| MD5 |
3df43a40e5745e11a6752a8a12bba6f0
|
|
| BLAKE2b-256 |
abdbead443d1fa464a405b5b8d183405e6651efc3181ed85d06f2fe5e7695936
|
File details
Details for the file browser_toolkit-0.0.1a2-py3-none-any.whl.
File metadata
- Download URL: browser_toolkit-0.0.1a2-py3-none-any.whl
- Upload date:
- Size: 24.8 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 |
ec7a3de2ad736ab3aba99806e8c5c1e417251a07ff9775739e88e804fae8f16f
|
|
| MD5 |
28d63c34dc0fe08eebc53d76d80c2e0b
|
|
| BLAKE2b-256 |
861b7e61c5151ed67df0076e22a16bedf7982ad776a81351be80be747b1a95e0
|