【发布时间】:2016-05-13 15:14:22
【问题描述】:
我需要很多图片。一个很好的来源当然是 Google 图片搜索。
我一直在寻找最好的方法来做到这一点。获得较小的“缩略图”图像是可能的,但我想要原始尺寸。
使用:
//*[@id="rg_s"]/div/div/text()
我确实找到了原始大小的 URL。例如:
{"cb":9,"cl":9,"cr":9,"ct":9,"id":"twpCKa-qACVbrM:","isu":"twitter.com",
"itg":false,"ity":"jpg","oh":512,"ou":
"https://pbs.twimg.com/profile_images/698459967624474624/FsezpZpl.jpg",
"ow":512,"pt":"Manchester United (@ManUtd) | Twitter","rid":"5Q1F7uGUbUotPM",
"ru":"https://twitter.com/manutd","s":"","sc":1,"th":225,"tu":
"https://encrypted-tbn2.gstatic.com/images?
q\u003dtbn:ANd9GcRELkTX0VqGU4OHs9sgS93dedTCNsW0TvJT3S72YuOCCHfXxZSa","tw":225}
有: https://pbs.twimg.com/profile_images/698459967624474624/FsezpZpl.jpg
作为原始大小的 URL。我真的不知道这个文本块实际上可以在网站上的哪个位置找到。但是我想知道的是,它自己的 URL 是否可以被隔离和提取?
【问题讨论】:
-
不在 XPath 中。您需要用其他东西解析内部 JSON。
标签: c# .net xpath web-crawler