I'm setting the headers following way
headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'cache-control': 'no-cache',
...
}
And calling request like that:
yield scrapy.Request(url='https:/myurl.com/', callback=self.parse,
headers=headers, cookies=cookies, meta={'proxy': 'http://localhost:8888'})
And it makes that scrapy capitalizes all these headers and it looks like that (I'm using Charles proxy for debugging):
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Cache-Control: no-cache
And this is not working correctly for my case.
If I'm using curl and set headers lowercase
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
cache-control: no-cache
everything works like a charm.
Is there any way how I can disable this capitalizing behavior in Scrapy? Thanks for any help!
curlwith capitalized headers and checking whether it gives the same output. If it does, your problem isn't what you think it is. - holdenweb