import requests from bs4 import BeautifulSoup ... url = "https://example.com" req = requests.get(url, headers) soup = BeautifulSoup(req.content, 'html.parser') print(soup.prettify())