Downloading PDF using Selenium Java not working in Chrome
问题 I have written the following code to disable the Chrome PDF viewer so that the PDF file can be downloaded automatically in the C:\downloads folder when the link is opened in Chrome. ChromeOptions options = new ChromeOptions(); Map<String, Object> prefs = new HashMap<>(); prefs.put("download.default_directory", "C:\\downloads"); prefs.put("download.prompt_for_download", false); prefs.put("plugins.always_open_pdf_externally", true); options.setExperimentalOption("prefs", prefs); options