title: how to automate saving web pages as PDF or HTML files using python
body: <p>I have about 300 web URLS. I'll save them either as PDF or as HTML pages.
  In order to have access to these web pages I must be logged in.</p>
  <p>I've tried chrome --headless but it saves a blank page!</p>
  <pre><code>chrome --headless --print-to-pdf=&quot;C:\\1.pdf&quot; https://myurl.com
  </code></pre>
  <p>I wanted to try selenium in python but it has always opened a new Session where I wasn't logged in. I've used <a href="https://stackoverflow.com/questions/31136581/automate-print-save-web-page-as-pdf-in-chrome-python-2-7">this code</a></p>
  <p>Could you please suggest me a solution?</p>
  <p>Best Regards</p>