Import error: No module name urllib2 in python 3. Next Step?

481    Asked by DrucillaTutt in Python , Asked on Feb 1, 2021
Answered by Drucilla Tutt

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()

print(html)



Your Answer

Interviews

Parent Categories