0 votes
1 view
in Python by (47.8k points)

Here's my code:

import urllib2.request 

response = urllib2.urlopen("http://www.google.com") 

html = response.read() 


Any help?

1 Answer

0 votes
by (107k points)
edited by

Instead of your code you can use the below-mentioned code to get rid of import error:-

from urllib.request import urlopen 

html = urlopen("http://www.google.com/").read() 


To know more about this you can have a look at the following video tutorial:-

Welcome to Intellipaat Community. Get your technical queries answered by top developers !