Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return results[0].description causes error list index out of range #94

Open
Scotchex opened this issue Feb 11, 2021 · 1 comment · May be fixed by #93
Open

return results[0].description causes error list index out of range #94

Scotchex opened this issue Feb 11, 2021 · 1 comment · May be fixed by #93

Comments

@Scotchex
Copy link

Scotchex commented Feb 11, 2021

The title alone is self explanatory.
Here is the code if anyone is interested:

``
from googleapi import google
def search(query):
num_page = 1
results = google.search(query, num_page)
return results[1].description
def convert(string):
li = list(string.split('.'))
return li

userin = input('?')
info = search(userin)
print(convert(info)[0])
``

@kulla
Copy link

kulla commented Feb 11, 2021

This is due to changes of Google in their HTML. At #93 I have written a fix which works fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants