Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
通过这个你可以连接到你的真实浏览器,在那里你已经登录了所有账户。
from browser_use import Agent, Browser, BrowserConfig from langchain_openai import ChatOpenAI import asyncio # 配置浏览器以连接到你的 Chrome 实例 browser = Browser( config=BrowserConfig( # 指定你的 Chrome 可执行文件的路径 chrome_instance_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', # macOS 路径 # Windows 通常为: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' # Linux 通常为: '/usr/bin/google-chrome' ) ) # 使用你配置的浏览器创建代理 agent = Agent( task="你的任务", llm=ChatOpenAI(model='gpt-4o'), browser=browser, ) async def main(): await agent.run() input('按回车键关闭浏览器...') await browser.close() if __name__ == '__main__': asyncio.run(main())
Was this page helpful?