Reputation: 63
I copied an example whcich use this library but when i get to the line import urllib2
it gives me an error : No module named 'urllib2'.
I searched for a download of the library but couldnt found.
Anyone can help me?
Thank you.
Upvotes: 2
Views: 237
Reputation: 481
I guess you are using Python 3. In Python 3, urllib2 is renamed to urllib.
More info Python urllib
Upvotes: 1
Reputation: 27216
It's most probable that you are using Python 3.
With Python versions > 3, those relevant modules are structured like this:
Current Name Replacement Name
urllib2 urllib.request, urllib.error
urlparse urllib.parse
urllib urllib.parse, urllib.request, urllib.error [6]
robotparser urllib.robotparser
Upvotes: 3