mirror of
https://github.com/browser-use/browser-use
synced 2026-04-22 17:45:09 +02:00
bump dependency versions
This commit is contained in:
@@ -1 +1 @@
|
||||
3.11
|
||||
3.12
|
||||
|
||||
2217
browser_use/cli.py
2217
browser_use/cli.py
File diff suppressed because it is too large
Load Diff
@@ -16,136 +16,137 @@ from patchright.async_api import async_playwright as async_patchright
|
||||
|
||||
from browser_use.browser import BrowserSession
|
||||
|
||||
llm = ChatOpenAI(model='gpt-4o')
|
||||
llm = ChatOpenAI(model="gpt-4o")
|
||||
|
||||
terminal_width, terminal_height = shutil.get_terminal_size((80, 20))
|
||||
|
||||
|
||||
async def main():
|
||||
patchright = await async_patchright().start()
|
||||
patchright = await async_patchright().start()
|
||||
|
||||
print('\n\nNORMAL BROWSER:')
|
||||
# Default Playwright Chromium Browser
|
||||
normal_browser_session = BrowserSession(
|
||||
# executable_path=<defaults to playwright builtin browser stored in ms-cache directory>,
|
||||
user_data_dir=None,
|
||||
headless=False,
|
||||
# deterministic_rendering=False,
|
||||
# disable_security=False,
|
||||
)
|
||||
await normal_browser_session.start()
|
||||
await normal_browser_session.create_new_tab('https://abrahamjuliot.github.io/creepjs/')
|
||||
await asyncio.sleep(5)
|
||||
await (await normal_browser_session.get_current_page()).screenshot(path='normal_browser.png')
|
||||
imgcat(Path('normal_browser.png').read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await normal_browser_session.close()
|
||||
print("\n\nNORMAL BROWSER:")
|
||||
# Default Playwright Chromium Browser
|
||||
normal_browser_session = BrowserSession(
|
||||
# executable_path=<defaults to playwright builtin browser stored in ms-cache directory>,
|
||||
user_data_dir=None,
|
||||
headless=False,
|
||||
stealth=False,
|
||||
# deterministic_rendering=False,
|
||||
# disable_security=False,
|
||||
)
|
||||
await normal_browser_session.start()
|
||||
await normal_browser_session.create_new_tab("https://abrahamjuliot.github.io/creepjs/")
|
||||
await asyncio.sleep(5)
|
||||
await (await normal_browser_session.get_current_page()).screenshot(path="normal_browser.png")
|
||||
imgcat(Path("normal_browser.png").read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await normal_browser_session.close()
|
||||
|
||||
print('\n\nPATCHRIGHT STEALTH BROWSER:')
|
||||
patchright_browser_session = BrowserSession(
|
||||
# cdp_url='wss://browser.zenrows.com?apikey=your-api-key-here&proxy_region=na',
|
||||
# or try anchor browser, browserless, steel.dev, browserbase, oxylabs, brightdata, etc.
|
||||
playwright=patchright,
|
||||
user_data_dir='~/.config/browseruse/profiles/stealth',
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
deterministic_rendering=False,
|
||||
)
|
||||
await patchright_browser_session.start()
|
||||
await patchright_browser_session.create_new_tab('https://abrahamjuliot.github.io/creepjs/')
|
||||
await asyncio.sleep(5)
|
||||
await (await patchright_browser_session.get_current_page()).screenshot(path='patchright_browser.png')
|
||||
imgcat(Path('patchright_browser.png').read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await patchright_browser_session.close()
|
||||
print("\n\nPATCHRIGHT STEALTH BROWSER:")
|
||||
patchright_browser_session = BrowserSession(
|
||||
# cdp_url='wss://browser.zenrows.com?apikey=your-api-key-here&proxy_region=na',
|
||||
# or try anchor browser, browserless, steel.dev, browserbase, oxylabs, brightdata, etc.
|
||||
user_data_dir="~/.config/browseruse/profiles/stealth",
|
||||
stealth=True,
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
deterministic_rendering=False,
|
||||
)
|
||||
await patchright_browser_session.start()
|
||||
await patchright_browser_session.create_new_tab("https://abrahamjuliot.github.io/creepjs/")
|
||||
await asyncio.sleep(5)
|
||||
await (await patchright_browser_session.get_current_page()).screenshot(path="patchright_browser.png")
|
||||
imgcat(Path("patchright_browser.png").read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await patchright_browser_session.close()
|
||||
|
||||
# Brave Browser
|
||||
if Path('/Applications/Brave Browser.app/Contents/MacOS/Brave Browser').is_file():
|
||||
print('\n\nBRAVE BROWSER:')
|
||||
brave_browser_session = BrowserSession(
|
||||
executable_path='/Applications/Brave Browser.app/Contents/MacOS/Brave Browser',
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
user_data_dir='~/.config/browseruse/profiles/brave',
|
||||
deterministic_rendering=False,
|
||||
)
|
||||
await brave_browser_session.start()
|
||||
await brave_browser_session.create_new_tab('https://abrahamjuliot.github.io/creepjs/')
|
||||
await asyncio.sleep(5)
|
||||
await (await brave_browser_session.get_current_page()).screenshot(path='brave_browser.png')
|
||||
imgcat(Path('brave_browser.png').read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await brave_browser_session.close()
|
||||
# Brave Browser
|
||||
if Path("/Applications/Brave Browser.app/Contents/MacOS/Brave Browser").is_file():
|
||||
print("\n\nBRAVE BROWSER:")
|
||||
brave_browser_session = BrowserSession(
|
||||
executable_path="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
user_data_dir="~/.config/browseruse/profiles/brave",
|
||||
deterministic_rendering=False,
|
||||
)
|
||||
await brave_browser_session.start()
|
||||
await brave_browser_session.create_new_tab("https://abrahamjuliot.github.io/creepjs/")
|
||||
await asyncio.sleep(5)
|
||||
await (await brave_browser_session.get_current_page()).screenshot(path="brave_browser.png")
|
||||
imgcat(Path("brave_browser.png").read_bytes(), height=max(terminal_height - 15, 40))
|
||||
await brave_browser_session.close()
|
||||
|
||||
if Path('/Applications/Brave Browser.app/Contents/MacOS/Brave Browser').is_file():
|
||||
print('\n\nBRAVE + PATCHRIGHT STEALTH BROWSER:')
|
||||
brave_patchright_browser_session = BrowserSession(
|
||||
executable_path='/Applications/Brave Browser.app/Contents/MacOS/Brave Browser',
|
||||
playwright=patchright,
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
user_data_dir=None,
|
||||
deterministic_rendering=False,
|
||||
**patchright.devices['iPhone 13'], # emulate other devices: https://playwright.dev/python/docs/emulation
|
||||
)
|
||||
await brave_patchright_browser_session.start()
|
||||
await brave_patchright_browser_session.create_new_tab('https://abrahamjuliot.github.io/creepjs/')
|
||||
await asyncio.sleep(5)
|
||||
await (await brave_patchright_browser_session.get_current_page()).screenshot(path='brave_patchright_browser.png')
|
||||
imgcat(Path('brave_patchright_browser.png').read_bytes(), height=max(terminal_height - 15, 40))
|
||||
if Path("/Applications/Brave Browser.app/Contents/MacOS/Brave Browser").is_file():
|
||||
print("\n\nBRAVE + PATCHRIGHT STEALTH BROWSER:")
|
||||
brave_patchright_browser_session = BrowserSession(
|
||||
executable_path="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
|
||||
playwright=patchright,
|
||||
headless=False,
|
||||
disable_security=False,
|
||||
user_data_dir=None,
|
||||
deterministic_rendering=False,
|
||||
# **patchright.devices['iPhone 13'], # emulate other devices: https://playwright.dev/python/docs/emulation
|
||||
)
|
||||
await brave_patchright_browser_session.start()
|
||||
await brave_patchright_browser_session.create_new_tab("https://abrahamjuliot.github.io/creepjs/")
|
||||
await asyncio.sleep(5)
|
||||
await (await brave_patchright_browser_session.get_current_page()).screenshot(path="brave_patchright_browser.png")
|
||||
imgcat(Path("brave_patchright_browser.png").read_bytes(), height=max(terminal_height - 15, 40))
|
||||
|
||||
input('Press [Enter] to close the browser...')
|
||||
await brave_patchright_browser_session.close()
|
||||
input("Press [Enter] to close the browser...")
|
||||
await brave_patchright_browser_session.close()
|
||||
|
||||
# print()
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://abrahamjuliot.github.io/creepjs/ and verify that the detection score is >50%.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# print()
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://abrahamjuliot.github.io/creepjs/ and verify that the detection score is >50%.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
|
||||
# input('Press Enter to close the browser...')
|
||||
# input('Press Enter to close the browser...')
|
||||
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://bot-detector.rebrowser.net/ and verify that all the bot checks are passed.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# input('Press Enter to continue to the next test...')
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://bot-detector.rebrowser.net/ and verify that all the bot checks are passed.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# input('Press Enter to continue to the next test...')
|
||||
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://www.webflow.com/ and verify that the page is not blocked by a bot check.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# input('Press Enter to continue to the next test...')
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://www.webflow.com/ and verify that the page is not blocked by a bot check.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# input('Press Enter to continue to the next test...')
|
||||
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://www.okta.com/ and verify that the page is not blocked by a bot check.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://www.okta.com/ and verify that the page is not blocked by a bot check.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://nowsecure.nl/ check the "I'm not a robot" checkbox.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
# agent = Agent(
|
||||
# task="""
|
||||
# Go to https://nowsecure.nl/ check the "I'm not a robot" checkbox.
|
||||
# """,
|
||||
# llm=llm,
|
||||
# browser_session=browser_session,
|
||||
# )
|
||||
# await agent.run()
|
||||
|
||||
# input('Press Enter to close the browser...')
|
||||
# input('Press Enter to close the browser...')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "browser-use"
|
||||
description = "Make websites accessible for AI agents"
|
||||
authors = [{ name = "Gregor Zunic" }]
|
||||
version = "0.2.5"
|
||||
version = "0.2.6"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11,<4.0"
|
||||
classifiers = [
|
||||
@@ -13,32 +13,31 @@ classifiers = [
|
||||
dependencies = [
|
||||
"anyio>=4.9.0",
|
||||
"httpx>=0.27.2",
|
||||
"pydantic>=2.10.4,<2.11.0",
|
||||
"pydantic>=2.11.5",
|
||||
"python-dotenv>=1.0.1",
|
||||
"requests>=2.32.3",
|
||||
"posthog>=3.7.0",
|
||||
"playwright>=1.52.0",
|
||||
"markdownify==1.1.0",
|
||||
"langchain-core==0.3.63",
|
||||
"langchain-openai==0.3.18",
|
||||
"langchain-anthropic==0.3.3",
|
||||
"langchain-ollama==0.3.0",
|
||||
"langchain-google-genai==2.1.2",
|
||||
"langchain-openai==0.3.19",
|
||||
"langchain-anthropic==0.3.14",
|
||||
"langchain-ollama==0.3.3",
|
||||
"langchain-google-genai==2.1.5",
|
||||
"langchain-deepseek>=0.1.3",
|
||||
"langchain>=0.3.21",
|
||||
"langchain-aws>=0.2.11",
|
||||
"google-api-core>=2.24.0",
|
||||
"langchain>=0.3.25",
|
||||
"langchain-aws>=0.2.24",
|
||||
"google-api-core>=2.25.0",
|
||||
"pyperclip>=1.9.0",
|
||||
"pyobjc>=11.0; platform_system == 'darwin'",
|
||||
"screeninfo>=0.8.1; platform_system != 'darwin'",
|
||||
"typing-extensions>=4.12.2",
|
||||
"psutil>=7.0.0",
|
||||
"faiss-cpu>=1.9.0",
|
||||
"mem0ai==0.1.93",
|
||||
"faiss-cpu>=1.11.0",
|
||||
"mem0ai>=0.1.104",
|
||||
"uuid7>=0.1.0",
|
||||
"patchright>=1.52.4",
|
||||
]
|
||||
# pydantic: >2.11 introduces many pydantic deprecation warnings until langchain-core upgrades their pydantic support lets keep it on 2.10
|
||||
# google-api-core: only used for Google LLM APIs
|
||||
# pyperclip: only used for examples that use copy/paste
|
||||
# pyobjc: only used to get screen resolution on macOS
|
||||
|
||||
Reference in New Issue
Block a user