0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

browser-use 試してみた

Last updated at Posted at 2025-01-05
from langchain_openai import ChatOpenAI
from browser_use import Agent, BrowserConfig, Browser
import asyncio


# `playwright install` is required to run this example
# Basic configuration
config = BrowserConfig(headless=False, disable_security=True)


async def main():
    agent = Agent(
        browser=Browser(config=config),
        task="食べログで六本木の焼肉店4つ見つけて",
        llm=ChatOpenAI(model="gpt-4o-mini"),
    )
    result = await agent.run()
    print(result)


asyncio.run(main())

これでtabelogの検索してくれる。

Screenshot 2025-01-05 at 22.06.56.png

headlessにしたい場合は、 headless=TrueにすればOK

結果がこちら

1. 焼肉 冷麺 ユッチャン
2. 焼肉うしごろ 西麻布本店
3. 熟成焼肉 肉源 六本木店
4. 焼肉 乃木坂

すごい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?