I am using this answer
to download and save webpages as a pdf.
Although the method works, it is saving the output files in a different directory.
What could I add to the code to specify a custom output directory?
In addition to that, is there a way to change the output file name?
This is the code so far:
import json
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
settings = {"recentDestinations": [{"id": "Save as PDF", "origin": "local", "account": ""}], "selectedDestinationId": "Save as PDF", "version": 2}
prefs = {'printing.print_preview_sticky_settings.appState': json.dumps(settings)}
chrome_options.add_experimental_option('prefs', prefs)
chrome_options.add_argument('--kiosk-printing')