我试图抓取一个网站,从产品页面我试图报废产品说明,但我如何只选择产品说明:
xPath : hxs.select('//div[@class="product-shop"]/p/text()').extract()
HTML非常大,因此请查看上面指定的链接。。在
我只想选择产品描述而不是其他细节。。。在
如果我这样做:
^{pr2}$但我只想要:
[u'This product is part of the Basics T.shirts line made of 100% Cotton. Stripes Muscle Fit T.shirts that come in Green Color. Casual that comes with Henley away.']
右键单击chrome中元素面板中的元素会告诉我:
指向
^{pr2}$在this page上尝试相同的XPATH也会指向其中的描述:
所以看起来你只需要在页面上调用XPATH就可以设置了。但是,您仍然应该验证XPATH在所有情况下都能正常工作,因为它总是很容易根据页面而变化。在
相关问题 更多 >
编程相关推荐