Scrapy commands

2017-07-18  本文已影响0人  方方块

.extract() - list of items
.extract_first() - the string converted from unicode ('u')
response.urljoin(relative url) - make absolute url
scrapy.htttp.request or selector.follow - simulate clicking onto next page, follow allows relative path

xpath

xpath('//*[contains(@class, "star-rating")]/@class')
xpath(''//*[@id="product_description"]/following-sibling::p/text()'')
上一篇下一篇

猜你喜欢

热点阅读