在本地运行 GPT-Crawler 需要以下步骤和条件:
environmental preparation
- mounting Node.js 16+ 和 npm(可通过
node -v
cap (a poem)npm -v
验证) - Git 工具(用于克隆仓库)
Specific steps
- cloning project::
git clone https://github.com/BuilderIO/gpt-crawler.git
- Installation of dependencies:进入项目目录后执行
npm install
- Configuration parameters: Modification
config.ts
文件中的关键配置:url
:起始爬取地址selector
:指定内容区域的 CSS 选择器maxPagesToCrawl
:控制爬取规模
- Start the crawler: Run
npm start
后,结果将保存在根目录的output.json
center
注意:首次运行时需确保网络畅通以完成依赖下载,动态网页抓取可能需要额外时间加载资源。
This answer comes from the articleGPT-Crawler: Automatically Crawling Website Content to Generate Knowledge Base DocumentsThe