Selenium2Pdf Example of Generating Formatted PDF Using Selenium To run Python3 Selenium2Pdf.py Note If you run webdriver without --headless flag, it will fail with the wonderfully clear error 'Printing is not available' 🙄.