Metadata-Version: 2.4
Name: re-browser-use
Version: 0.6.1
Summary: Patching Browser Use to make it work with more websites and URLs ...
Project-URL: Repository, https://github.com/imamousenotacat/re-browser-use
Author: Gregor Zunic, patched by github.com/imamousenotacat/
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: <4.0,>=3.11
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: aiohttp==3.12.15
Requires-Dist: anthropic==0.58.2
Requires-Dist: anyio>=4.9.0
Requires-Dist: authlib>=1.6.0
Requires-Dist: bubus>=1.5.4
Requires-Dist: cdp-use>=1.4.0
Requires-Dist: google-api-core>=2.25.0
Requires-Dist: google-api-python-client>=2.174.0
Requires-Dist: google-auth-oauthlib>=1.2.2
Requires-Dist: google-auth>=2.40.3
Requires-Dist: google-genai==1.29.0
Requires-Dist: groq>=0.30.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: markdown-pdf==1.5
Requires-Dist: markdownify==1.1.0
Requires-Dist: mcp>=1.10.1
Requires-Dist: ollama>=0.5.1
Requires-Dist: openai==1.99.2
Requires-Dist: portalocker<3.0.0,>=2.7.0
Requires-Dist: posthog>=3.7.0
Requires-Dist: psutil>=7.0.0
Requires-Dist: pydantic>=2.11.5
Requires-Dist: pyobjc>=11.0; platform_system == 'darwin'
Requires-Dist: pypdf>=5.7.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: re-cdp-patches>=0.9.1
Requires-Dist: requests>=2.32.3
Requires-Dist: screeninfo>=0.8.1; platform_system != 'darwin'
Requires-Dist: typing-extensions>=4.12.2
Requires-Dist: uuid7>=0.1.0
Provides-Extra: all
Requires-Dist: boto3>=1.38.45; extra == 'all'
Requires-Dist: botocore>=1.37.23; extra == 'all'
Requires-Dist: click>=8.1.8; extra == 'all'
Requires-Dist: imgcat>=0.6.0; extra == 'all'
Requires-Dist: langchain-openai>=0.3.26; extra == 'all'
Requires-Dist: rich>=14.0.0; extra == 'all'
Requires-Dist: textual>=3.2.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: boto3>=1.38.45; extra == 'aws'
Provides-Extra: cli
Requires-Dist: click>=8.1.8; extra == 'cli'
Requires-Dist: rich>=14.0.0; extra == 'cli'
Requires-Dist: textual>=3.2.0; extra == 'cli'
Provides-Extra: eval
Requires-Dist: anyio>=4.9.0; extra == 'eval'
Requires-Dist: browserbase==1.4.0; extra == 'eval'
Requires-Dist: datamodel-code-generator>=0.26.0; extra == 'eval'
Requires-Dist: hyperbrowser==0.47.0; extra == 'eval'
Requires-Dist: lmnr[all]==0.7.6; extra == 'eval'
Requires-Dist: pillow>=11.2.1; extra == 'eval'
Requires-Dist: psutil>=7.0.0; extra == 'eval'
Provides-Extra: examples
Requires-Dist: botocore>=1.37.23; extra == 'examples'
Requires-Dist: imgcat>=0.6.0; extra == 'examples'
Requires-Dist: langchain-openai>=0.3.26; extra == 'examples'
Description-Content-Type: text/markdown

<h1 align="center">Enable AI to control your browser 🤖</h1>

___A patched, drop-in replacement for [browser-use](https://github.com/browser-use/browser-use), capable of defeating Cloudflare's verification.___

```diff
- NOTE: 
- It seems that after getting rid of Playwright and having done an amazing piece of work developing 
- their own event bus and SafeType CDP client, this use case is still not being contemplated, 
- so I had to do it myself...

- Pre 0.6.1 versions of this project used to depend on a tweaked version of patchright 
- (https://github.com/imamousenotacat/re-patchright) but not anymore.

- I still need to upload new gif files. Coming soon... 😎
```

This little project was created because I was fed up with getting blocked by Cloudflare's verification and I wanted to do things like this with Browser Use:

<a id="using-proton-vpn.gif"></a>
```bash
python examples\nopecha_cloudflare_no_playwright.py
```

![nopecha_cloudflare.py](https://raw.githubusercontent.com/imamousenotacat/re-browser-use/main/images/using-proton-vpn.gif)

I have added OS level clicks in headful mode to be able to use ProtonVPN. Credit again to [Vinyzu](https://github.com/Vinyzu),
as I used a pruned and slightly modified version of his [CDP-Patches](https://github.com/imamousenotacat/re-cdp-patches) project for this. 

The one below, I think, is a browser-use test that has been long-awaited and sought after for quite a while 😜:

```bash
python tests/ci/evaluate_tasks.py --task tests/agent_tasks/captcha_cloudflare.yaml
```

![captcha_cloudflare.yaml](https://raw.githubusercontent.com/imamousenotacat/re-browser-use/main/images/captcha_cloudflare.yaml.gif)

If it looks slow, it is because I'm using a small and free LLM and an old computer worth $100. 

# Quick start

This is how you can see for yourself how it works:

Install the package using pip (Python>=3.11):

```bash
pip install re-browser-use
```

Install the browser as described in the [browse-use](https://github.com/browser-use/browser-use) repository.

```bash
uvx playwright install chromium --with-deps --no-shell
```

Create a minimalistic `.env` file. This is what I use. I'm a poor mouse and I can afford only free things. 🙂

```bash
GOOGLE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ANONYMIZED_TELEMETRY=false
SKIP_LLM_API_KEY_VERIFICATION=true
HEADLESS_EVALUATION=false
```

And finally tell your agent to pass Cloudflare's verification:

```bash
python examples\nopecha_cloudflare_no_playwright.py
```

You will get something very similar to the animated gif above [animated gif above](#using-proton-vpn.gif). This is the code of the example file:

```python
import asyncio
from browser_use import BrowserProfile, BrowserSession
from browser_use.agent.service import Agent
from dotenv import load_dotenv
from browser_use.llm import ChatGoogle

load_dotenv()


async def main():
  agent = Agent(
    task=(
    "Go to https://nopecha.com/demo/cloudflare, and always wait 10 seconds for the verification checkbox to appear."
    "Once it appears, click it once, and wait 5 more seconds. That’s all. Your job is done. Don't check anything. If you get redirected, don’t worry."
    ),
    llm=ChatGoogle(model="gemini-2.5-flash-lite"),
    browser_session=BrowserSession(
      browser_profile=BrowserProfile(
        headless=False,
        cross_origin_iframes=True,
      )
    )
  )
  await agent.run(10)

asyncio.run(main())
```

If you want to run the same code with _"regular"_ browser-use to compare the results, uninstall re-browser-use and install browser-use instead:

```bash
pip uninstall re-browser-use -y
pip install browser-use==0.6.1 # This is the last version I've patched so far
```

Now run again the script

```bash
python examples\nopecha_cloudflare_no_playwright.py
```

![nopecha_cloudflare_unfolded.py KO](https://raw.githubusercontent.com/imamousenotacat/re-browser-use/main/images/nopecha_cloudflare_unfolded.py.KO.gif)

With the current versions of browser-use, this still won't work.

## Why is this project not a PR?

I don't want to ruffle any feathers, but we, humble but rebellious mice 😜, don't like signing CLAs or working for free for someone who, 
[by their own admission](https://browser-use.com/careers), is here to "dominate". I do this just for fun. 

Besides, the code provided by this patch won't work if it's not accompanied by [re-patchright-python](https://github.com/imamousenotacat/re-patchright-python).

I just wanted to make this work public. If someone finds this useful, they can incorporate it into their own projects. 

------

## Citation

If you use Browser Use in your research or project, please cite:

```bibtex
@software{browser_use2024,
  author = {Müller, Magnus and Žunič, Gregor},
  title = {Browser Use: Enable AI to control your browser},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/browser-use/browser-use}
}
```

<div align="center">
Made with ❤️ in Zurich and San Francisco
 </div>
