Google-Search-API
Google-Search-API copied to clipboard
how to set time limit between every request?
I don't want google to detect this system as bot. so what can i do. I want to perform 100 of pages to be redirected without getting ban. Time doesn't matter.
Simply wait a random time between queries using time.sleep(). Note that every 100 queries, you should wait a little bit more. This way has worked for me without getting 503 errors.
import time
from random import randint
count = 0
for query in queries:
search_results = google.search(query,ncr=True)
# do whatever you wanna do with the results, then
if count % 100 != 0:
nap = randint(45,60)
else:
nap = randint(180,240)
count +=1
time.sleep(nap)
I want the result for same query. there will be one query and the page will be 100 in number.
my code
from google import google
num_page = 100
query= input("Enter Search Query: ")
query = que+query
search_results = google.search(query, num_page)
for result in search_results:
# my code to play with results
i want some result of 100 page for a specific query without getting marked as bot or robot. time doesn't matter. how to do it?
Oh, I see. The query is "just one", but you're actually making it 100 times, for pages 1 to 100. This is a workaround you can use:
- Edit the function search from google/modules/standard_search.py, and add a time.sleep() somewhere in the
for i in range(pages):
loop.
I already did but actually not working.