【发布时间】:2021-07-08 12:44:04
【问题描述】:
我运行一个 NodeJS 服务器。我有时会删除页面而忘记删除参考。我想测试所有内部链接是否正常工作。我想象一个爬虫和一个 npm 测试包,可以建立一个从主页链接的所有内部页面的列表,并确认它们返回 200 状态代码。
实现这一目标的最佳框架是什么?
【问题讨论】:
标签: node.js testing web-crawler
我运行一个 NodeJS 服务器。我有时会删除页面而忘记删除参考。我想测试所有内部链接是否正常工作。我想象一个爬虫和一个 npm 测试包,可以建立一个从主页链接的所有内部页面的列表,并确认它们返回 200 状态代码。
实现这一目标的最佳框架是什么?
【问题讨论】:
标签: node.js testing web-crawler
无需重新发明轮子。
我已经为此目的使用了hyperlink NPM 包。
【讨论】:
hyperlink 爬虫。是对的吗?是否有其他软件包在部署之前在本地执行?
hyperlink 进行操作。只需将其指向您的本地文件,并将 --canonicalroot 设置为真正的公共 URL。
http://localhost:3000/。知道了谢谢!你能推荐另一个包吗?不幸的是,hyperlink 引入了 11 个未通过npm audit fix --force 修复的高严重性问题:deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.