命令行网站刮刀
webgrep的Python项目详细描述
webgrep是一个简单的工具,用于从命令行中删除网站
设置: >;sudo easy_安装webgrep
示例: 查找有关GoodReads的书籍的分级数
使用-g选项在html中查找“ratings”的位置: >;webgrep.py-g“评分”-u“http://www.goodreads.com/book/show/4588.Extremely_Loud_and_Incredibly_Close” 匹配,位置 “267896额定值”,“1,3,1,3,5,3,7,1,3,5,14,1,0”
现在使用该位置值(“1,3,1,3,5,3,7,1,3,5,14,1,0”)作为-l参数,在不同的页面上查找相同的位置 >;webgrep.py-l“1,3,1,3,5,3,7,1,3,5,14,1,0”-u“http://www.goodreads.com/book/show/1618.The_Curious_Incident_of_the_Dog_in_the_Night_Time” “778683额定值”
示例: 在位置值中使用“-”作为通配符。希望在一页中找到所有IMDB标题
>;webgrep.py-g肖申克-u“http://www.imdb.com/search/title?num_votes=50000,&release_date=1990,&sort=user_rating,desc&title_type=feature” 匹配,位置 肖申克的救赎,“1,3,3,1,14,12,3,5,3,5,3,0”
>;webgrep.py-g“黑暗骑士”-u“http://www.imdb.com/search/title?num_votes=50000,&release_date=1990,&sort=user_rating,desc&title_type=feature” 匹配,位置 黑暗骑士,“1,3,3,1,14,12,3,5,5,5,3,0” 黑暗骑士升起,“1,3,3,1,14,12,3,5,69,5,3,0”
>;webgrep.py-l“1,3,3,1,14,12,3,5,-,5,3,0”-u“http://www.imdb.com/search/title?num_votes=50000,&release_date=1990,&sort=user_rating,desc&title_type=feature” 肖申克的救赎 黑暗骑士 辛德勒的名单 低俗小说 指环王:国王的回归 …
常见错误: 在bash中引用-u参数,否则'&;'可能会被读取为在后台运行进程,而不是在url中运行一部分