This release is a pre-release and may not be stable for production use.
browser-toolkit
Browser Toolkit provides a single agnostic interface to interact with different browser automations libraries.
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())
Methods Supported per Browser Automation Library:
BaseWebElement:
| Method | Pydoll | Selenium | Playwright | Camoufox | Description |
|---|---|---|---|---|---|
get_text |
✅ | ✅ | ✅ | ✅ | Gets the element's text |
get_attribute |
✅ | ✅ | ✅ | ✅ | Gets an attribute value |
get_position |
✅ | ✅ | ✅ | ✅ | Gets the element's bounding box |
click |
✅ | ✅ | ✅ | ✅ | Clicks the element |
click_js |
✅ | ✅ | ✅ | ✅ | Clicks via JavaScript |
type |
✅ | ✅ | ✅ | ✅ | Types text into the element |
clear |
✅ | ✅ | ✅ | ✅ | Clears the element |
query |
✅ | ✅ | ✅ | ✅ | Finds the first matching child element |
query_all |
✅ | ✅ | ✅ | ✅ | Finds all matching child elements |
BaseBrowserToolkit:
| Category | Method | Pydoll | Selenium | Playwright | Camoufox | Description |
|---|---|---|---|---|---|---|
| Session management | close_page |
✅ | ✅ | ✅ | ✅ | Closes the current tab |
| Session management | close_browser |
✅ | ✅ | ✅ | ✅ | Closes the browser and all tabs |
| Selectors | query |
✅ | ✅ | ✅ | ✅ | Finds the first matching element |
| Selectors | query_all |
✅ | ✅ | ✅ | ✅ | Finds all matching elements |
| Actions | goto |
✅ | ✅ | ✅ | ✅ | Navigates to a URL |
| Actions | click |
✅ | ✅ | ✅ | ✅ | Clicks an element |
| Actions | click_js |
✅ | ✅ | ✅ | ✅ | Clicks an element via JavaScript |
| Actions | type |
✅ | ✅ | ✅ | ✅ | Types text into an element |
| Actions | clear |
✅ | ✅ | ✅ | ✅ | Clears an element |
| Actions | scroll_to_element |
✅ | ✅ | ✅ | ✅ | Scrolls to an element |
| Actions | scroll_to_top |
✅ | ✅ | ✅ | ✅ | Scrolls to the top of the page |
| Actions | scroll_to_bottom |
✅ | ✅ | ✅ | ✅ | Scrolls to the bottom of the page |
| Actions | reload |
✅ | ✅ | ✅ | ✅ | Reloads the page |
| Actions | hard_reload |
✅ | ✅ | ✅ | ✅ | Reloads the page ignoring cache |
| Page data | current_url |
✅ | ✅ | ✅ | ✅ | Gets the current URL |
| Page data | title |
✅ | ✅ | ✅ | ✅ | Gets the page title |
| Page data | page_source |
✅ | ✅ | ✅ | ✅ | Gets the page's HTML source |
| Page data | get_text |
✅ | ✅ | ✅ | ✅ | Gets an element's text |
| Page data | get_attribute |
✅ | ✅ | ✅ | ✅ | Gets an element's attribute value |
| Page data | save_screenshot |
✅ | ✅ | ✅ | ✅ | Saves a screenshot of the page |
| Network | get_network_requests |
✅ | ✅ | ✅ | ✅ | Gets all network requests |
| Network | get_network_response_body |
✅ | ✅ | ❌ | ❌ | Gets a request's response body |
| Scripts | execute_script |
✅ | ✅ | ✅ | ✅ | Runs JavaScript on the page |
| Scripts | execute_cdp_cmd |
❌ | ✅ | ✅ | ✅ | Runs a Chrome DevTools Protocol command |
| Wait | element_is_present |
✅ | ✅ | ✅ | ✅ | Waits for an element to exist |
| Wait | element_is_visible |
✅ | ✅ | ✅ | ✅ | Waits for an element to be visible |
| Wait | element_is_invisible |
✅ | ✅ | ✅ | ✅ | Waits for an element to be invisible |
| Wait | element_is_clickable |
✅ | ✅ | ✅ | ✅ | Waits for an element to be clickable |
| Wait | text_is_present |
✅ | ✅ | ✅ | ✅ | Waits for text inside an element |
| Wait | alert_is_present |
❌ | ✅ | ✅ | ✅ | Waits for a browser alert |
| Wait | page_is_loading |
✅ | ✅ | ✅ | ✅ | Checks if the page is still loading |
| Session data | get_all_cookies |
✅ | ✅ | ✅ | ✅ | Gets all cookies |
| Session data | add_cookie |
✅ | ✅ | ✅ | ✅ | Adds a cookie |
| Session data | delete_all_cookies |
✅ | ✅ | ✅ | ✅ | Deletes all cookies |
| Session data | delete_cookie_by_name |
❌ | ✅ | ✅ | ✅ | Deletes a cookie by name |
| Session data | delete_cookie_filter |
❌ | ✅ | ✅ | ✅ | Deletes cookies matching filters |
| Session data | get_all_local_storage |
✅ | ✅ | ✅ | ✅ | Gets all local storage items |
Metadata
Release files for browser-toolkit 0.0.1a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| browser_toolkit-0.0.1a4.tar.gz | 23.0 kB | Without provenance | Details for browser_toolkit-0.0.1a4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| browser_toolkit-0.0.1a4-py3-none-any.whl | Python 3 | none | any | Details for browser_toolkit-0.0.1a4-py3-none-any.whl |
Total release size: 54.1 kB
Release files / browser_toolkit-0.0.1a4.tar.gz
| Download URL | browser_toolkit-0.0.1a4.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c4a543d683b944dbe186f4630edf9c3dc5d0fdb65938681d0a6039657389dc3
|
|
BLAKE2b-256 checksum How to use checksums |
bd919ec86dcd6d4c7beca5d060fdc925a6cfd7e164ff191de306b6463c58049d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / browser_toolkit-0.0.1a4-py3-none-any.whl
| Download URL | browser_toolkit-0.0.1a4-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe1cbfd35c50be94f75a85801b5ca1c61077fa66e7e1ccb5625ed1c808e569fa
|
|
BLAKE2b-256 checksum How to use checksums |
a37cf12290acbcb1246703681aaa10a9d49fd57fe8494f0d06e5e4b49b5aed5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for browser-toolkit 0.0.1a4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.