检查网页或完整网站中的链接和资源
linkcheckerjs的Python项目详细描述
linkcheckerjs是最好的工具来检查你的网站。它使用phantomjs解析页面,以便检测所有错误,即使这些错误来自css或javascript。linkcheckerjs在mit许可下是免费的。
安装
要求
- python=2.6
- 节点&npm:请参阅node doc
通过PIP安装
pip install linkcheckerjs
从源安装
cd where_i_want_to_clone_linkcheckerjs git clone https://github.com/LeResKP/linkcheckerjs.git cd linkcheckerjs python setup.py install
基本用法
要递归地检查像“https://www.python.org”这样的url,只需在终端中键入以下命令:
linkcheckerjs https://www.python.org
注意
不会对外部链接(不在同一域上)进行强检查。它只检查页面本身,也不检查资源和链接。
高级用法
我们不会看到创建json并在这里单独显示输出的强大功能,因为它正在开发中。 但现在,当您丢失linkcheckerjs命令的输出时,它非常有用。
运行linkcheckerjs时可以创建json输出:
linkcheckerjs https://www.python.org -o /tmp/linkcheckerjs-output.json
要读取生成的json,请键入终端:
linkreaderjs https://www.python.org -o /tmp/linkcheckerjs-output.json