我重新创建了XHR请求。当我们在浏览器窗口中输入XHR请求URL时,因为它是一个GET方法,如果第一次打我有部分JSON输出。如果我们点击重新加载,下次加载更多的数据似乎很奇怪。任何人都可以帮助我。在此先感谢scrapy shell响应不同于scrapy抓取响应
我在Scrapy shell中尝试过的另一个信息也给出了整个JSON响应。
代码:
import scrapy
import datetime
import time
from scrapy.http.request import Request
class test (scrapy.Spider):
name = "test"
allowed_domains = "ar.trivago.com"
def start_requests(self):
yield scrapy.Request("http://ar.trivago.com/search/region?iPathId=38715&iGeoDistanceItem=47160&aDateRange%5Barr%5D=2015-11-13&aDateRange%5Bdep%5D=2015-11-14&iRoomType=7&tgs=4716002&aHotelTestClassifier=&aPriceRange%5Bfrom%5D=0&aPriceRange%5Bto%5D=0&iIncludeAll=0&iGeoDistanceLimit=20000&aPartner=&iViewType=0&bIsSeoPage=false&bIsSitemap=false&&_=1446825699501",
callback=self.parse)
def parse(self, response):
print "RESPONSE::", response.body
请帮我解决这个
感谢您的回复。仍然只获得部分回应。 – Sabeena
您是否注意到scrapy shell给出了完整的回复。我试着在假要求和原始要求之间进行睡眠,7次成功完成2次,这是不准确的。 – Sabeena