lightcrawler轻型爬虫
lightcrawler 可以抓取网站并通过 Google lighthouse 运行网站。
npm install --save-dev lightcrawler
lightcrawler --url https://atom.io/ --config lightcrawler-config.json
lightcrawler-config.json
看起来像这样:
{
"extends": "lighthouse:default",
"settings": {
"crawler": {
"maxDepth": 2,
"maxChromeInstances": 5
},
"onlyCategories": [
"Accessibility",
"Performance",
"Best Practices"
],
"onlyAudits": [
"accesskeys",
"aria-allowed-attr",
"external-anchors-use-rel-noopener",
"geolocation-on-start",
"no-document-write",
"no-mutation-events",
"no-old-flexbox",
"time-to-interactive",
"user-timings",
"viewport",
"without-javascript"
]
}
}
评论