Metadata-Version: 2.4
Name: browser-toolkit
Version: 0.0.1a1
Summary: Toolkit that provides a single inteface to interact with different browser automations.
Project-URL: Homepage, https://github.com/toriium/browser-toolkit
Project-URL: Documentation, https://github.com/toriium/browser-toolkit/blob/master/README.md
Project-URL: Repository, https://github.com/toriium/browser-toolkit
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: camoufox>=0.4.11
Requires-Dist: playwright>=1.60.0
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pydoll-python>=2.23.0
Requires-Dist: selenium>=4.44.0
Dynamic: license-file

# 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
```python
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())
```
