Documentation Index
Fetch the complete documentation index at: https://firecrawl.web3doc.top/llms.txt
Use this file to discover all available pages before exploring further.
使用Firecrawl进行抓取
Firecrawl将网页转换为Markdown,非常适合LLM应用程序。原因如下:
-
管理复杂性:
处理代理、缓存、速率限制和JavaScript阻止的内容,以实现顺畅的抓取。
-
动态内容:
从JavaScript渲染的网站、pdf、图片等中收集数据。
-
Markdown或结构化数据转换:
将收集到的数据转换为干净的Markdown或结构化输出,非常适合LLM处理或其他任务。
更多详情,请参阅抓取端点API参考。
抓取一个URL
/scrape端点
用于抓取URL并获取其内容。
使用示例
from firecrawl import FirecrawlApp
app = FirecrawlApp(api_key="YOUR_API_KEY")
content = app.scrape_url("https://mendable.ai")
SDK将直接返回数据对象。cURL将返回如下所示的负载。
{
"success": true,
"data": {
"content": "原始内容 ",
"markdown": "# Markdown内容",
"provider": "web-scraper",
"metadata": {
"title": "Mendable | AI for CX and Sales",
"description": "AI for CX and Sales",
"language": null,
"sourceURL": "https://www.mendable.ai/"
}
}
}