Advertisement
TTpocToXaKep

Parse all html of site

Feb 1st, 2023
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # https://pastebin.com/u/TTpocToXaKep
  2. import requests
  3. from bs4 import BeautifulSoup
  4.  
  5. # Make a get request to fetch the raw HTML content
  6. html_content = requests.get('https://www.python.org/').text
  7.  
  8. # Parse the html content
  9. soup = BeautifulSoup(html_content, "lxml")
  10.  
  11. # Print the parsed data of html
  12. print(soup.prettify())  # print the parsed data of html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement