crawlee
sonder 小杯

爬取网页数据的一个工具crawlee, 地址: https://crawlee.dev

安装

1
2
3
4
5
npx crawlee create my-crawler

cd my-crawler

npm start

示例

1
2
3
4
5
6
7
8
9
10
import { CheerioCrawler } from 'crawlee';

const crawler = new CheerioCrawler({
async requestHandler({ $, request }) {
const title = $('title').text();
console.log(`The title of "${request.url}" is: ${title}.`);
}
})

await crawler.run(['https://www.baidu.com']);
  • 本文标题:crawlee
  • 本文作者:sonder
  • 创建时间:2022-12-02 16:36:12
  • 本文链接:https://sonderss.github.io/2022/12/02/crawlee/
 评论