2

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
asked Mar 28, 2014 at 15:44
1
  • Why version of Python? Commented Mar 28, 2014 at 15:45

2 Answers 2

3

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
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.