我为提取机器人链接制作了以下正则表达式:
re.compile(r"/\S+(?:\/+)")
我得到以下结果:
/includes/
/modules/
/search/
/?q=user/password/
/?q=user/register/
/node/add/
/logout/
/?q=admin/
/themes/
/?q=node/add/
/admin/
/?q=comment/reply/
/misc/
//example.com/
//example.com/site/
/profiles/
//www.robotstxt.org/wc/
/?q=search/
/user/password/
/?q=logout/
/comment/reply/
/?q=filter/tips/
/?q=user/login/
/user/register/
/user/login/
/scripts/
/filter/tips/
//www.sxw.org.uk/computing/robots/
如何排除具有两个斜杠的链接,例如:
//www.sxw.org.uk/computing/robots/
//www.robotstxt.org/wc/
//example.com/
//example.com/site/
有任何想法吗 ??