🕸️ AI Webscraper代理
一个基于人工智能的网络抓取代理,使用Brightdata MCP服务器从网络中提取和总结内容。采用模块化架构构建,结合了LLM推理、强大的抓取和简单的web界面。
______________________________________________________________________
🔧 技术栈
- 前端: 溪流
- 后端: 快速API
- 语言python
- 抓取: Brightdata MCP服务器
- AI模型:人类学法学硕士(克劳德)
______________________________________________________________________
🚀 特性
- 从网站提取数据的自然语言界面
- 使用Brightdata MCP进行可靠的网页抓取
- LLM驱动的总结和推理
- 基于Streamlit的交互式前端
- 异步FastAPI后端集成
______________________________________________________________________
环境变量
创建.env文件并配置以下内容:
# .env
# Environment Variables for AI Webscraper Agent
# Replace 'your_key_here' with your actual API keys
# Bright Data
API_TOKEN=your_key_here
WEB_UNLOCKER_ZONE=your_key_here
BROWSER_AUTH="your_browser_auth_token"
#Anthropic AI API KEY
ANTHROPIC_API_KEY=your_key_here📦 安装
git clone https://github.com/yourusername/ai-webscraper-agent.git
cd ai-webscraper-agent
uv pip install -r requirements.txt运行应用程序
启动FastAPI后端服务器和Streamlit应用程序
启动后端FastAPI服务器
uv run backend.py启动前端Streamlit应用程序
streamlit run frontend.py示例用法
问:
Scrape the top 5 news headlines from https://bbc.com and summarize them.获取响应:
1. Headline A - Summary
2. Headline B - Summary
3. Headline C - Summary
4. Headline C - Summary
...代理流
\[用户提示\]➡ \[流媒体用户界面\]➡ \[FastAPI路由器\]➡ \[LLM代理\] ➡ \[通过MCP使用Brightdata工具\]➡ \[LLM概述\]➡ \[UI响应\]
