Python 3.x 为什么邮递员请求和剪贴请求将我发送到不同的web?
我做了这个蜘蛛,当我提出请求时,把我送到不同的网络 很遗憾,我使用了相同的参数和几乎相同的标题Python 3.x 为什么邮递员请求和剪贴请求将我发送到不同的web?,python-3.x,post,scrapy,request,Python 3.x,Post,Scrapy,Request,我做了这个蜘蛛,当我提出请求时,把我送到不同的网络 很遗憾,我使用了相同的参数和几乎相同的标题 def start_requests(self): url ="https://assr.parcelquest.com/Statewide" rows =self.getPin('parcels/Parcel.csv') for row in rows: params = {
def start_requests(self):
url ="https://assr.parcelquest.com/Statewide"
rows =self.getPin('parcels/Parcel.csv')
for row in rows:
params = {
'co3': 'MRN',
'apn': 022-631-01,
'recaptchaSuccess':'0',
'IndexViewModel': 'PQGov.Models.IndexViewModel'
}
header = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept' : '*/*',
'host':'assr.parcelquest.com',
'Referer': 'https://assr.parcelquest.com/Statewide/Index',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36',
'Accept-Encoding':'gzip, deflate, br',
'Connection':'keep-alive'
}
#print(params)
yield scrapy.Request(url=self.url,headers=header,body=json.dumps(params),method='POST',callback=self.property,meta = {'parcel':row},dont_filter=True)
我是邮递员:
能解释一下原因吗?我打赌
'apn':022-631-01,
做了一些与您期望的不同的事情:)在我的Python版本中,这是一个语法错误(语法错误:十进制整数文本中不允许前导零;对八进制整数使用0o前缀
)可能是因为我读了一个文件而只写了022-631-01,但这应该是“022-631-01”,很抱歉我的错误