'Saving webpage as pdf with selenium and chromedriver with not default name
Could anyone tell me if there is any option to save pdf file with not default name? In my code everything works fine, the only thing i would like to change is a name of file. Maybe i should add something in setting or prefs? I would like the name to be the same what user input at the begining of the script. Thats the part of my code. Thanks for help in advance.
isin = input('Please provide ISIN: ')
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
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),
'savefile.default_directory': 'PATH'}
options.add_experimental_option('prefs', prefs)
options.add_argument('--kiosk-printing')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
