Advertisement
dereksir

Untitled

Aug 25th, 2023 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. # Define your target URL
  5. url = 'https://scrapingclub.com/exercise/list_infinite_scroll/'
  6.  
  7. # Send an HTTP GET request and fetch the HTML content
  8. response = requests.get(url)
  9.  
  10. # Fetch the HTML content
  11. html_content = response.text
  12.    
  13. # Parse the HTML content using Beautiful Soup
  14. soup = BeautifulSoup(html_content, 'html.parser')
  15.    
  16. # Print formatted HTML content
  17. print(soup.prettify())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement