pytrends icon indicating copy to clipboard operation
pytrends copied to clipboard

How to use the proxies feature?

Open newskooler opened this issue 4 years ago • 5 comments

Hi,

I can't really figure out how to use the proxies feature. If anyone can explain in more detail, it would be really helpful and appreciated.

Background I downloaded about 3 years worth of data with about 0.5 second sleep. Everything was fine. When I started downloading data again, I got the following error:

The request failed: Google returned a response with code 429

So even 30 min after that, I still get this error. I thought it's a great time to try the proxies out, but no luck still : /

newskooler avatar Mar 08 '20 20:03 newskooler

I have the same question, waiting on an answer.

diggyg97 avatar Apr 20 '20 07:04 diggyg97

Still waiting :(

nimish38 avatar Jun 02 '20 11:06 nimish38

same here

yesid-lopez avatar Dec 17 '20 07:12 yesid-lopez

1 year after this prob still remains...==

Kkkassini avatar Aug 13 '21 08:08 Kkkassini

Ok, you need a list of HTTPS or HTTP proxies, you can find these lists for free every where just search up HTTPS proxy list in google. then you need to check the proxies that you got through a proxy checker, or do it yourself. Website like https://hidemy.name/en/proxy-checker/ will check proxies. After this if you only have HTTP you need to find the library files in you venv file, its called request.py in that file you need to change all instances of https to http that aren't part of full urls. An easy way to find this file is by using vscode and right clicking, and clicking on go to definition. So one of the lines of code should be proxy = {'https': self.proxies[self.proxy_index]}, change that to proxy = {'http': self.proxies[self.proxy_index]}, and do that for all of them, don't change for example 'https://trends.google.com/?geo={geo}' to 'http://trends.google.com/?geo={geo}', that will break it. After all that save the file and run the code. It should work!

Cursed-Gato avatar Mar 19 '22 19:03 Cursed-Gato