试试Scrapegraph-ai
Scrapegraph-ai 是一个基于大型语言模型(LLM)和代理工作流(Agent Workflow)构建的下一代网络爬虫,它利用了前沿的人工智能技术来提高网络数据抓取的效率和准确性。
支持 Groq、Llama3 等模型,Prompt 指挥抓取:这表明 Scrapegraph-ai 支持使用特定的查询语言(如 Groq)和大型语言模型(如 Llama3)来指导爬虫的行为。通过使用 Prompt(提示),用户可以更精确地控制爬虫抓取的内容,这使得爬虫能够更智能地理解和响应用户的需求。
支持 Playwright 处理 JS 渲染的网页:Playwright 是一个用于自动化跨浏览器测试的库,它支持无头模式,并且能够处理 JavaScript 渲染的网页。这意味着 Scrapegraph-ai 可以处理那些依赖于 JavaScript 动态加载内容的复杂网站,这对于传统的静态爬虫来说是一个挑战。
基于 graph builder 与 html、image、speech 节点可以自定义抓取和 parse 逻辑:Scrapegraph-ai 提供了一个图构建器(graph builder),允许用户自定义抓取逻辑。它支持对 HTML、图像和语音等不同类型的数据节点进行抓取和解析。这意味着用户可以根据自己的需求定制爬虫的行为,使其能够从网页中提取特定的数据。
安装
pip install scrapegraphai playwright install示例代码,后端大模型使用了ollama
from scrapegraphai.graphs import SmartScraperGraph
graph_config = {
"llm": {
"model": "ollama/mistral",
"temperature": 0,
"format": "json", # Ollama needs the format to be specified explicitly
"base_url": "http://localhost:11434", # set Ollama URL
},
"embeddings": {
"model": "ollama/nomic-embed-text",
"base_url": "http://localhost:11434", # set Ollama URL
}
}
smart_scraper_graph = SmartScraperGraph(
prompt="List me all the articles",
# also accepts a string with the already downloaded HTML code
source="https://perinim.github.io/projects",
config=graph_config
)
result = smart_scraper_graph.run()
print(result)github:https://github.com/VinciGit00/Scrapegraph-ai
网友回复
什么是Harness Engineering?
同一个中英混合文本不同大模型计算tokens长度一致吗?
Browser Use / Playwright / Puppeteer 与Chrome DevTools Protocol(CDP)的关系?
能否在三维空间调用ai的api实现vrm模型执行任意的姿势动作与行走完成任务?
如何让openclaw小龙虾自动帮你打电话聊客户?
各大公司推出的claw是否是为了大家消费自己的大模型tokens?
云服务器什么配置才能部署openclaw?
为啥ai生成视频模型只能5秒10秒或15秒生成,不能一次生成1分钟1i小时呢?
技术上如何解决被曝光的ai投毒geo行为?
有没有哪个大模型可以根据声音和文字描述生成带声音的视频?


