Metadata-Version: 2.4
Name: re-browser-use
Version: 0.4.2
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: anthropic>=0.54.0
Requires-Dist: anyio>=4.9.0
Requires-Dist: authlib>=1.6.0
Requires-Dist: bubus>=1.2.2
Requires-Dist: google-api-core>=2.25.0
Requires-Dist: google-genai>=1.21.1
Requires-Dist: groq>=0.28.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: markdownify==1.1.0
Requires-Dist: mem0ai>=0.1.106
Requires-Dist: ollama>=0.5.1
Requires-Dist: openai>=1.81.0
Requires-Dist: playwright>=1.52.0
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: pyperclip>=1.9.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: re-patchright>=1.52.10
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: browserbase>=0.4.0; 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: stagehand-py>=0.3.6; 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: datamodel-code-generator>=0.26.0; extra == 'eval'
Requires-Dist: lmnr[all]>=0.6.11; 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: browserbase>=0.4.0; extra == 'examples'
Requires-Dist: imgcat>=0.6.0; extra == 'examples'
Requires-Dist: langchain-openai>=0.3.26; extra == 'examples'
Requires-Dist: stagehand-py>=0.3.6; extra == 'examples'
Description-Content-Type: text/markdown

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

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:

```bash
python examples\nopecha_cloudflare.py
```

![nopecha_cloudflare.py](https://github.com/user-attachments/assets/2f16e2b4-9cef-4b4a-aa2d-e6ebf039cd14)

or this one:

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

![captcha_cloudflare.yaml](https://github.com/user-attachments/assets/5dd906d5-a453-4fc7-ad26-0ccee1e30bb0)

# 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. I'm using Chromium; it works OK for me. The project uses a [tweaked version of patchright](https://github.com/imamousenotacat/re-patchright)

```bash
re-patchright 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.py
```

This is the code of the example file 

```python
import asyncio
from dotenv import load_dotenv
load_dotenv()
from browser_use import Agent
from langchain_google_genai import ChatGoogleGenerativeAI

async def main():
  agent = await Agent.create_stealth_agent(
    task=(
      "Go to https://nopecha.com/demo/cloudflare, wait for the verification checkbox to appear, click it once, and wait for 10 seconds."
      "That’s all. If you get redirected, don’t worry."
    ),
    llm=ChatGoogleGenerativeAI(model="gemini-2.5-flash-lite-preview-06-17"),
  )
  await agent.run(10)

asyncio.run(main())
```

I have in the same directory an 'unfolded' version of the code named _nopecha_cloudflare_unfolded.py_.   
By _"unfolded"_ I mean that my simple helper static method _'Agent.create_stealth_agent'_ is not used. So we can test it with _"regular"_ patchright and browser-use:

Uninstall re-patchright (including the browsers, to be thorough) and re-browser-use and install patchright and browser-use instead: 

```bash
re-patchright uninstall --all 
pip uninstall re-patchright -y
pip uninstall re-browser-use -y

pip install patchright
patchright install chromium --with-deps --no-shell
uv pip install browser-use==0.4.2 # This is the version I'm working on
```

Now execute the program 

```bash
python examples\nopecha_cloudflare_unfolded.py
```

![nopecha_cloudflare_unfolded.py KO](https://github.com/user-attachments/assets/d2367520-38cd-463a-8ed7-a82907517df6)

With the current versions of patchright and browser-use it will never work.

------

## 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"> <img src="https://github.com/user-attachments/assets/06fa3078-8461-4560-b434-445510c1766f" width="400"/> 
 
[![Twitter Follow](https://img.shields.io/twitter/follow/Gregor?style=social)](https://x.com/intent/user?screen_name=gregpr07)
[![Twitter Follow](https://img.shields.io/twitter/follow/Magnus?style=social)](https://x.com/intent/user?screen_name=mamagnus00)
 
 </div>

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