【发布时间】:2020-11-04 02:40:13
【问题描述】:
这是我的代码:
# -*- coding: utf-8 -*-
import scrapy
class GameSpider(scrapy.Spider):
name = 'game'
allowed_domains = ['store.steampowered.com']
start_urls = ['https://store.steampowered.com/search/results/?query&start=0&count=50&dynamic_data=&sort_by=_ASC&snr=1_7_7_230_7&category1=998&infinite=1']
def parse(self, response):
print(response.body)
game_href = str(response.xpath(".//@href").extract())
print(game_href)
我的问题是当我运行scrapy 时,我只得到 17 个链接(总共 50 个链接)。我尝试检查response.body,它是正确的。
【问题讨论】: