Python 2.7版
我想获取每个新的背景图像url和标题,但是当我尝试获取图像url时,我总是使用xpath获取空数组。你知道吗
以下是我尝试的:
scrapy shell http://www.wownews.tw/fashion/movie
然后呢
response.body
我可以在终端上看到html数据。但是当我打字的时候
response.xpath('//div[@class="text ng-scope"]')
得到空数组,我觉得应该是工作。你知道吗
问题是因为类包含空格吗?你知道吗
如何修复?任何帮助都将不胜感激。你知道吗
我试过命令还是得到空数组
response.xpath('//div[contains(concat(" ", normalize-space(@class), " "), "text ng-scope")]')
这是你需要的一切
参考https://medium.com/@yashpokar/scrape-any-website-in-the-internet-without-using-splash-or-selenium-68a6c9733369
相关问题 更多 >
编程相关推荐