AI网页抓取代理

一个基于AI的网页抓取代理,使用Brightdata MCP服务器从网页中提取和总结内容,结合了LLM推理、强大的抓取能力和简单的Web界面。

  • by appugouda-architect
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 appugouda-architect/ai-webscraper-agent

使用说明

🕸️ AI Webscraper代理

一个基于人工智能的网络抓取代理,使用Brightdata MCP服务器从网络中提取和总结内容。采用模块化架构构建,结合了LLM推理、强大的抓取和简单的web界面。


🔧 技术栈


🚀 特性

  • 从网站提取数据的自然语言界面
  • 使用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响应]