0

In Google Chrome, when you are on a website, you can right-click -> save as ... -> Web Page, complete. I would like to do the same, but automatically with a python3 script. I have this code so far using the requests package in python, but it only saves the file like when I do right-click -> save as ... -> Web Page, HTML only.:

# https://www.w3schools.com/python/ref_requests_get.asp
import requests

x = requests.get('https://w3schools.com')
print(x.status_code)

TLDR: Tried saving complete webpage as html, but only getting raw html

  • 1
    [This answer](https://stackoverflow.com/a/53919316/14637) might get you at least part of the way there. – Thomas Nov 23 '22 at 08:45
  • Does this answer your question? [Save complete web page (incl css, images) using python/selenium](https://stackoverflow.com/questions/53729201/save-complete-web-page-incl-css-images-using-python-selenium) – Stephen Ostermiller Nov 23 '22 at 11:00
  • try to use [playwright](https://playwright.dev/python/docs/library) – Danila Ganchar Nov 23 '22 at 11:21

0 Answers0