Automate print/save web page as pdf in chrome - python 3.6 Automate print/save web page as pdf in chrome - python 3.6 google-chrome google-chrome

Automate print/save web page as pdf in chrome - python 3.6


Ok, I think I figured out the solution. Just append the following line with the below code:

profile = {'printing.print_preview_sticky_settings.appState':json.dumps(appState),'savefile.default_directory':downloadPath}

It's not ideal still as you cannot specify the new file name you want but it works for now.

If anyone has a better solution, please do post it here. Thanks