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,170 points
193 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,160 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,780 points
528 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
231 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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,033 views
0 votes
0 answers
+4 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,810 points
1,556 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,160 points
111 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 17, 2020 in Python by MD
• 95,160 points
147 views