chore: update integration examples and gitignore

- browser_use: migrate to BrowserSession + bundled ChatOpenAI API
- crawl4ai: add browser_mode="cdp" param
- gitignore: add captures/
This commit is contained in:
CloakHQ
2026-04-02 01:32:08 +02:00
parent 1bfd5ca036
commit 1b91a33e51
3 changed files with 6 additions and 7 deletions
+1
View File
@@ -65,3 +65,4 @@ deploy.sh
.env .env
debug debug
publish-docker.sh publish-docker.sh
captures
+4 -6
View File
@@ -3,14 +3,13 @@
browser-use handles AI agent logic, CloakBrowser handles bot detection. browser-use handles AI agent logic, CloakBrowser handles bot detection.
Your agent can now browse sites behind Cloudflare, reCAPTCHA, DataDome. Your agent can now browse sites behind Cloudflare, reCAPTCHA, DataDome.
Requires: pip install browser-use cloakbrowser langchain-openai Requires: pip install browser-use cloakbrowser
Set OPENAI_API_KEY (or swap for another LLM provider). Set OPENAI_API_KEY (or swap for another LLM provider).
""" """
import asyncio import asyncio
from browser_use import Agent, Browser, BrowserConfig from browser_use import Agent, BrowserSession, ChatOpenAI
from langchain_openai import ChatOpenAI
from cloakbrowser import launch_async from cloakbrowser import launch_async
@@ -23,14 +22,13 @@ async def main():
) )
# Step 2: Connect browser-use to the stealth browser via CDP # Step 2: Connect browser-use to the stealth browser via CDP
config = BrowserConfig(cdp_url="http://127.0.0.1:9242") session = BrowserSession(cdp_url="http://127.0.0.1:9242")
browser = Browser(config=config)
# Step 3: Run your AI agent — it browses through CloakBrowser # Step 3: Run your AI agent — it browses through CloakBrowser
agent = Agent( agent = Agent(
task="Go to https://www.google.com and search for 'browser automation'", task="Go to https://www.google.com and search for 'browser automation'",
llm=ChatOpenAI(model="gpt-4o-mini"), llm=ChatOpenAI(model="gpt-4o-mini"),
browser=browser, browser_session=session,
) )
result = await agent.run() result = await agent.run()
+1 -1
View File
@@ -21,7 +21,7 @@ async def main():
) )
# Step 2: Connect Crawl4AI to the stealth browser via CDP # Step 2: Connect Crawl4AI to the stealth browser via CDP
browser_config = BrowserConfig(cdp_url="http://127.0.0.1:9243") browser_config = BrowserConfig(browser_mode="cdp", cdp_url="http://127.0.0.1:9243")
run_config = CrawlerRunConfig() run_config = CrawlerRunConfig()
async with AsyncWebCrawler(config=browser_config) as crawler: async with AsyncWebCrawler(config=browser_config) as crawler: