Nv7-GitHub/googlesearch

Anyone facing Error 429? Client Error: Too Many Requests

Closed this issue · 9 comments

I am receiving 429 error after 5 or 6 searches. I know the code does randomly choose a different user agent which shouldn't bring this error, however I did get it. I'm running my script from the command promt and wanted to check if other uses are also facing the same issue. I also do not see any Retry After in the error message which doesn't help.

image

I would request the community to provide any insights on this or workarounds if any.

Thanks in advance.

I have the same problem of requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url. You may use time.sleep(0.06) in your code to slow down your query

I have the same problem of requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url. You may use time.sleep(0.06) in your code to slow down your query

Thanks @jason-huanghao .

I find out there are some queries that make the search function stall for over 1 minute, then they return 429, regardless of waiting time.
Ex. "Malaysia sugar tax, RM0.40 (US$0.086) per litre, more than 5 grams/100ml" takes a few seconds to retrieve the first 2 links, but at the 3rd, it makes me wait 1:30 mins, then returns 429, and the IP is unusable.
I tried the same query on Google Colab (that should not use my IP), yet, to be sure, I also tried switching internet connection to the phone hotspot and using an EC2, and all lead to the same results (breaking at the 3rd link of the same query): some queries can break the algorithm

Ideally, we should use the timeout params for the requests, but (I tried) it does not work in the case above. Any help is appreciated.

I am also experiencing the same error. I already tried forcefully adding a delay before a request but it is still returning the same 429 Client Error.

Can anybody help?

Same question. How to fix the problem of too many requests?

Google flags your code as a potential bot and the link actually shows a captcha to prove you're not. The best way to solve this is to just use their official Custom Search API as you're not allowed to use their search in the way this library does.

The user agents are randomized but I believe there is a bug where it sends many queries for some searches. I will investigate this.

I am not having this problem when I search "Malaysia sugar tax, RM0.40 (US$0.086) per litre, more than 5 grams/100ml", it sends 2 requests and finds this issue!