How to fetch HTML code using urllib module in Python

0 votes

Hi Guys,

I am new in Python. I want to fetch the HTML code of the Google webpage. Can anyone tell me how can I do that?

Jun 26, 2020 in Python by akhtar
• 38,230 points
746 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use urllib module to fetch the HTML code of a webpage. I have attached one example below for your reference.

from urllib.request import urlopen
html = urlopen("http://www.google.com/").read()
print(html)

I hope this will give you some ideas.

answered Jun 26, 2020 by MD
• 95,440 points

Related Questions In Python

0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,720 points
1,354 views
0 votes
1 answer

how to use urllib module in python?

If you are using Python 3.x then ...READ MORE

answered Jun 28, 2019 in Python by Neel
• 3,020 points
608 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,060 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
3,479 views
0 votes
1 answer

How to read photo using cv2 module in python?

Hi@akhtar, Yes, you can read your image in ...READ MORE

answered Apr 9, 2020 in Python by MD
• 95,440 points
504 views
0 votes
1 answer

How to remove a file using the OS module in Python?

Hi@akhtar, In Python, you can use the os. remove() method to remove ...READ MORE

answered Oct 18, 2020 in Python by MD
• 95,440 points
859 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP