I was currently playing with the 'urllib' module in python, and tried this to extract source code of a website:
import urllib
temp = urllib.request.urlopen('https://www.quora.com/#')
However, I get the following error:
Traceback (most recent call last): File "", line 1, in temp = urllib.request.urlopen('https://www.quora.com/#') AttributeError: 'module' object has no attribute 'request'
I am using Python 2.7.5 by the way.
It seems like you are reading Python 3.x documentation.
It's urllib.urlopen
in Python 2.x.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With