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.1a1.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.1a1.tar.gz.
File metadata
- Download URL: browser_toolkit-0.0.1a1.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 |
4d0b266b137f8781a2c3df5f7a241cac17d67f1bc8d13275dcf6410a49f95f08
|
|
| MD5 |
bd048693ed3448e0bdc8c0af7cd3c304
|
|
| BLAKE2b-256 |
fe5fa3eb52ea6f019e19ba7f44bfe7170ae5269d0028b8e0d0b67064a91f36d3
|
File details
Details for the file browser_toolkit-0.0.1a1-py3-none-any.whl.
File metadata
- Download URL: browser_toolkit-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 24.7 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 |
f2a6df7c9a279884b744cba3f4f425618548e27e2c389da0449d5902f803c6c2
|
|
| MD5 |
0a217e15557a47d17253570998919ea0
|
|
| BLAKE2b-256 |
f377e8892216b558722a75b86be4740713bdb7653fb4056a3b098a5afb8b048c
|