Metadata-Version: 2.4
Name: py-browser-automation
Version: 0.2.1
Summary: Automate online browsing using python and AI
License: MIT
License-File: LICENSE
Keywords: browser-automations,AI
Author: pUrGe12
Author-email: achintya.jai@owasp.org
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: bs4 (>=0.0.2,<0.0.3)
Requires-Dist: colorama (>=0.4.6,<0.5.0)
Requires-Dist: google-genai (>=1.45.0,<2.0.0)
Requires-Dist: openai (>=2.6.0,<3.0.0)
Requires-Dist: playwright (>=1.55.0,<2.0.0)
Requires-Dist: playwright-stealth (>=2.0.0,<3.0.0)
Requires-Dist: pydantic (>=2.12.0,<3.0.0)
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
Requires-Dist: requests (>=2.32.5,<3.0.0)
Requires-Dist: sqlalchemy (>=2.0.44,<3.0.0)
Description-Content-Type: text/markdown

# PyBA - Python Browser Automations

This is a no-code browser automation software written in python. It can visit any website, automate testing, repetitive tasks, form filling and more. This library is specifically built for more exploratory analysis than EXACT inputs (though it supports both through different modes).

## Idea

This library will allow you to run an inhouse playwright instance and automate any task. These tasks can be related to web-scraping, OSINT (OpenSource INTelligence) etc.

This is built on top of playwright and it requires either VertexAI or OpenAI API keys to do the "thinking" part of the process. The library also contains support to automatically login to your social media sites (you'll have to provide a username and password! Check the the [usage](#usage) section for more on that) so you can use it for SOCmint or simple automated social media interactions as well.

We optionally allow you to enable tracing, the logs of which you can see on playwright's `traceviewer`. We also support logging and config files should you want to change any defaults

## Why?

The need for such a software came when I was building a fully automated intelligence framework. The goal is to replicate everything a human can do on the internet, and automate that process. This tool will employ all sorts of anti-bot detection and anti-fingerprinting techniques (I am still learning about them...) and will make sure that nothing halts the automation.

## Installation

The library can be installed via `pip`:

```sh
pip install py-browser-automation
```

or you can install it from the source:

```sh
git clone https://github.com/FauvidoTechnologies/PyBrowserAutomation/
cd PyBrowserAutomation
pip install .
```

## Usage

> [!NOTE]
> For more detailed instructions visit the [docs](https://pyba.readthedocs.io/)

- Import the main engine using:

```python3
from pyba import Engine
```

- Set the right configurations depending on which model you want to use:

> For VertexAI
```python3
engine = Engine(vertexai_project_id="", vertexai_server_location="", handle_dependencies=False)
```

> For OpenAI
```python3
engine = Engine(openai_api_key="", handle_dependencies=False)
```

- Set `handle_dependencies` to `True` if you're running this for the first time and install the playwright browsers and other dependencies by following the instructions.

- Run the `sync` endpoint using `engine.sync_run()`

```python3
engine.sync_run(prompt="open instagram")
```

For more use cases, check out the [examples](./examples) direcrtory.

