It appears the search function is broken, and calls to the search function get stuck in an infinite loop.
You can reproduce this easily with a simple script like this one:
from googlesearch import search
import logging
logging.basicConfig(level=logging.DEBUG)
print("Starting search...")
res = search("nhl bowen byram")
print("Finished search.")
list_of_urls = [x for x in res]
print(list_of_urls)
Also tried to just convert the generator to a list with the same outcome:
from googlesearch import search
import logging
logging.basicConfig(level=logging.DEBUG)
print("Starting search...")
res = search("nhl bowen byram")
print(list(res))
print("Finished search.")
The output of the following:
Hello World
finished
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.google.com:443
DEBUG:urllib3.connectionpool:https://www.google.com:443 "GET /search?q=nhl%2Bbowen%2Bbyram&num=12&hl=en&start=0 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.google.com:443
DEBUG:urllib3.connectionpool:https://www.google.com:443 "GET /search?q=nhl%2Bbowen%2Bbyram&num=12&hl=en&start=0 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.google.com:443
DEBUG:urllib3.connectionpool:https://www.google.com:443 "GET /search?q=nhl%2Bbowen%2Bbyram&num=12&hl=en&start=0 HTTP/1.1" 200 None
To debug this further, I put trace statements in the package, and it looks like start and num_results are never updated:
It appears the search function is broken, and calls to the search function get stuck in an infinite loop.
You can reproduce this easily with a simple script like this one:
Also tried to just convert the generator to a list with the same outcome:
The output of the following:
To debug this further, I put trace statements in the package, and it looks like start and num_results are never updated:
Result: