mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
* Add captcha demo gif * Captcha demo * Host gif at imgur * Try to include from other repo * Hugging face example * Try to display mp4 * Include mp4 with raw link * Try with git user content .com * More methods * Update README.md * Add custom function * Try with only the link * Readme update * Display video * Flight search example * Update README.md * Update prompts * Prompts above videos * Space between div and video * Font size
32 lines
629 B
Python
32 lines
629 B
Python
"""
|
|
Simple try of the agent.
|
|
|
|
@dev You need to add OPENAI_API_KEY to your environment variables.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
import asyncio
|
|
|
|
from langchain_openai import ChatOpenAI
|
|
|
|
from browser_use import Agent
|
|
|
|
# NOTE: captchas are hard. For this example it works. But e.g. for iframes it does not.
|
|
# for this example it helps to zoom in.
|
|
llm = ChatOpenAI(model='gpt-4o')
|
|
agent = Agent(
|
|
task='go to https://captcha.com/demos/features/captcha-demo.aspx and solve the captcha',
|
|
llm=llm,
|
|
)
|
|
|
|
|
|
async def main():
|
|
await agent.run()
|
|
|
|
|
|
asyncio.run(main())
|