Get HTML Code of Any Website Using Python

Get HTML Code of Any Website Using Python

  • In this topic we learn how to get HTML code of any website using python.

Module Used

  • Request
  • BeautifulSoup

Need to install



Source Code:

#Follow - @Programmerfect

import requests
from bs4 import BeautifulSoup

URL = "https://www.programmerfect.com/"
page = requests.get(URL)

soup = BeautifulSoup(page.content,"html.parser")
print(soup.prettify())

Output:


 


Comments