文章詳情頁
python - 一個循環中對一個url進行post請求時,為什么只有一次爬取結果?
瀏覽:82日期:2022-09-11 16:17:20
問題描述
爬取代碼如下:
# 一個循環中對一個url進行post請求時 只有一次爬取結果? 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結果如下
循環做了3次,為什么只有一次爬取結果,是因為crawl同一個url嗎?
問題解答
回答1:url 相同
排行榜
