This commit is contained in:
parent
26b2e9efab
commit
41e092becc
|
@ -85,12 +85,12 @@ class JdSpider(scrapy.Spider):
|
||||||
# time.sleep(10)
|
# time.sleep(10)
|
||||||
|
|
||||||
if page>settings['COMMENT_MAX_PAGE']:
|
if page>settings['COMMENT_MAX_PAGE']:
|
||||||
print("评论抓取达到最大深度, %s, 页数: %d", product_id, page)
|
print("评论抓取达到最大深度, %s, 页数: %d" % (product_id, page))
|
||||||
else:
|
else:
|
||||||
yield Request(next_comment_url, self.parse_comment,
|
yield Request(next_comment_url, self.parse_comment,
|
||||||
meta={'product_id': product_id, 'page': page})
|
meta={'product_id': product_id, 'page': page})
|
||||||
else:
|
else:
|
||||||
print("评论抓取完成, %s, 页数: %d", product_id, page)
|
print("评论抓取完成, %s, 页数: %d" % (product_id, page))
|
||||||
|
|
||||||
def parse(self, response):
|
def parse(self, response):
|
||||||
items = response.xpath('//div[@id="plist"]//li[@class="gl-item"]')
|
items = response.xpath('//div[@id="plist"]//li[@class="gl-item"]')
|
||||||
|
|
Loading…
Reference in New Issue