search_results taking empty list values
For 90% of the time the search_results list is taking empty values in hence, i am facing out of range errors. Here is an example of the code that only works 10% of the time:
`from googleapi import google def googleSearch(searchterm): num_page = 1 search_results = google.search(searchterm, num_page) return search_results[0].description
x = input('search?') print(googleSearch(x))`
I got the same error. The reason is that Google made changes to their design and the HTML structure and thus the parsing failed. Since they use A/B testing for sure (X% of users get one design and other Y% of users get another design). Sometimes the parsing fails and sometimes not (the old design seem to be returned in 10% of the cases). I got at least 4 different HTML structures when I tested it. https://github.com/abenassi/Google-Search-API/pull/93 includes a fix for that...
i got the same, i'm trying to use it but the result is just an empty list.
from googleapi import google
num_page = 1
search_results = google.search("my query", num_page)
print(search_results)
did i miss some thing ? please help me, thank you so much.
Still doesn't work, seems deprecated no longer supported.
from googleapi import google
num_page = 1
search_results = google.search("google", num_page)
print(search_results)
for result in search_results:
print(result.link)
Result:
[]
[Finished in 1.2s]