Comments (4)
@tsukuuyomi
I had the same issue too and I only know the reason for the issue. Looking forward for the solution.
Reason for that is there's no package called urllib2 in python-3 version. It's only in python-2. Instead there's an equivalent which is urllib.request for it. I think the author should modify that in order to make it compatible for newer python version.
Please anyone help us in getting this issue resolved.
from googlesearch.
@shashank7596 just importing it as import urllib.request as urllib2
does not work either. :/
It gives me a weird 'list index out of range' error, presumably from the urllib.request.quote()
I am unsure of what causes the error, but just fixing the import does not seem to solve the issue.
I think there are a few changes I am missing.
from googlesearch.
this is still a problem it seems, tried the example on the module README
>>> from googlesearch.googlesearch import GoogleSearch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<HIDDENPATH>/site-packages/googlesearch/googlesearch.py", line 6, in <module>
import urllib2
ModuleNotFoundError: No module named 'urllib2'
>>> response = GoogleSearch().search("something")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'GoogleSearch' is not defined
>>> for result in response.results:
... print("Title: " + result.title)
... print("Content: " + result.getText())
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'response' is not defined
from googlesearch.
I am having the same issue, I peeked and found this line was the culprit.
totalText = soup.select(GoogleSearch.TOTAL_SELECTOR)[0].children.next().encode('utf-8')
Printing the soup object returns and empty list.
print(soup.select(GoogleSearch.TOTAL_SELECTOR)) # outputs []
I will dig more into it.
from googlesearch.
Related Issues (20)
- input conversion failed due to input error HOT 1
- HTTPError: HTTP Error 500: Internal Server Error HOT 1
- prefetch_pages vs prefetch_results
- HTTPError: Service Unavailable
- Too many requests
- How to access to the desired link number ? HOT 1
- ERROR
- Handling "HTTP Error 429" error.
- Urllib2 causing troubles HOT 4
- browser_agents.txt not found HOT 2
- too many arguments
- Selector not working anymore HOT 1
- IndexError: list index out of range HOT 1
- HttpError
- a search gives no result, no error, nothing HOT 11
- Default prefetch_pages argument make program feels like running forever!
- Search fails when results page shows no total HOT 2
- New Document Please HOT 1
- hi.googlesearch by default returned section all of google engine. yes? how I get results of googlenews section??thanks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlesearch.