Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- # Make a request to the website
- url = "http://www.yourwebsite.com" # replace with your website
- response = requests.get(url)
- # Parse the HTML content
- soup = BeautifulSoup(response.text, 'html.parser')
- # Save the website content to a file
- with open("website.html", "w", encoding='utf-8') as file:
- file.write(str(soup.prettify()))
Advertisement
Advertisement