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.
jfs
417k211 gold badges1k silver badges1.7k bronze badges
-
Why version of Python?Aaron Digulla– Aaron Digulla2014年03月28日 15:45:48 +00:00Commented Mar 28, 2014 at 15:45
2 Answers 2
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
answered Mar 28, 2014 at 15:47
utdemir
27.3k11 gold badges65 silver badges82 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
I guess you are using Python 3. In Python 3, urllib2 is renamed to urllib.
More info Python urllib
answered Mar 28, 2014 at 16:10
Conans
4812 gold badges4 silver badges14 bronze badges
Comments
lang-py