Quickstart
Start using Scrap Web with this quickstart guide
Prepare the environment
uv venv --python 3.11source .venv/bin/activateuv pip install scrap-webplaywright installCreate an agent
Last updated
Start using Scrap Web with this quickstart guide
uv venv --python 3.11source .venv/bin/activateuv pip install scrap-webplaywright installLast updated
from langchain_openai import ChatOpenAI
from swift_web import Agent
import asyncio
llm = ChatOpenAI(model="gpt-4o")
async def main():
agent = Agent(
task="Find a one-way flight from Bali to Oman on 12 January 2025 on Google Flights. Return me the cheapest option.",
llm=llm,
)
result = await agent.run()
print(result)
asyncio.run(main())OPENAI_API_KEY=
ANTHROPIC_API_KEY=