Open Michael-E-Rose opened 6 years ago
Hello Michael,
Thank's for reporting. This has been already discussed in Issue #4. But since that issue is more about language, I'll use this one for feedback on Python 3 compatibility.
As of now, google-search only supports Python 2. My next update on this library will probably address Python 3 compatibility. If you do feel like contributing, check out this pull-request that I have received which fixes Python 3 but breaks Python 2 compatibility.
I'll immediately review an pull any requests that build and succeed the tests.
Try changing to: import urllib
urllib.request for opening and reading URLs urllib.error containing the exceptions raised by urllib.request urllib.parse for parsing URLs urllib.robotparser for parsing robots.txt files
so changing to urllib.request
Hi Please have a look at my updated code which is compatible with Python 3.x versions. url: https://github.com/sripirakas/GoogleSearch/blob/master/googlesearch.py
Your code seems to work but I still can't import the module on my computer. Or was this not intended?
I just installed google-search from PyPi for Python3.5. Importing the library causes an
ImportError: No module named 'urllib2'
. I think the package needs some update in this regard, this might help.