Reputation: 97
I am making an Amazon Scraper and facing some kind of problem. Here is my code
def scrapedPage(self,URL, user_agent):
header = {"User-Agent": user_agent, 'Accept-Encoding': 'identity', 'Server': 'Server', 'Content-Type': 'text/html', 'Accept-Ranges': 'bytes', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-transform', 'Connection': 'keep-alive', 'Vary': 'Accept-Encoding' }
proxy = {'https': proxy}
page = requests.get(URL, headers=header, proxies=proxy)
return page
It returns status code 400 when I use in Django framework but the same code respond 200 status code when run stand alone without Django.
Upvotes: 1
Views: 45