python - 一個(gè)循環(huán)中對(duì)一個(gè)url進(jìn)行post請(qǐng)求時(shí),為什么只有一次爬取結(jié)果?
問題描述
爬取代碼如下:
# 一個(gè)循環(huán)中對(duì)一個(gè)url進(jìn)行post請(qǐng)求時(shí) 只有一次爬取結(jié)果? for page in range(1, int(page_count) + 1):print ’page:’, pageself.crawl(self.comment_url, method = ’POST’, data = {’type’: ’all’, ’currentPage’: page, ’totalCount’: product_detail_dict[’comment_count’], ’placeId’: ’’, ’productId’: product_detail_dict[’product_id’], ’placeIdType’: ’’, ’isPicture’: ’’, ’isBest’: ’’, ’isPOI’: ’Y’, ’isELong’: ’N’}, callback = self.comment_page, save = {’uuid’: product_detail_dict[’uuid’]})
debug結(jié)果如下
循環(huán)做了3次,為什么只有一次爬取結(jié)果,是因?yàn)閏rawl同一個(gè)url嗎?
問題解答
回答1:url 相同
