![]() ![]() Better to move this additional code to a function. When you open a PDF in Chrome, you see the Adobe Acrobat prompt in the upper-right corner of the window. To make the code stable you might need to add some exceptions handling. Using Open in Acrobat Reader option for PDFs opened in Chrome browser. Print(full_path+' is moved to '+full_new_path) If (timestamp_now - timestamp_file) < 15:įull_new_path = os.path.join(new_path, new_filename) You can either save pages within your web browser (perhaps in a reading list) or export the web pages outside your browser as screenshots. # if time delta is less than 15 seconds move this file There are many ways to save web pages for offline reading. ![]() Timestamp_file = os.path.getmtime(full_path) # time of file creation # Now go through the files in download directoryįor (dirpath, dirnames, filenames) in os.walk(download_path):įull_path = os.path.join(download_path, filename) New_filename = 'new_name.pdf' # Set the name of file New_path = r'C:\Users\Oli\Google Drive' # Path where to move fileĬhrome_options = webdriver.ChromeOptions()Ĭhrome_options.add_experimental_option('prefs', profile)Ĭhrome_options.add_argument('-kiosk-printing')ĭriver = webdriver.Chrome(chrome_options=chrome_options) Like: chrome_options.add_experimental_option("prefs", ĭownload_path = r'C:\Users\Oli\Downloads' # Path where browser save files fault_directory could be added not to appState but to "prefs" of add_experimental_option ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |