How to download a pdf file in chrome using selenium webdriver

前端 未结 5 941
生来不讨喜
生来不讨喜 2020-11-30 14:33

I want to download pdf in chrome using selenium.

System.setProperty(\"webdriver.chrome.driver\", System.getProperty(\"user.dir\")  
               + System.         


        
5条回答
  •  我在风中等你
    2020-11-30 15:09

    Are you using Adobe Acrobat/Adobe Reader to display the PDFs? If so, it is probably Abode's behavior you need to modify.

    Here are the steps I had to take:

    1. Open Adobe Reader
    2. Edit menu, Preferences
    3. Selcet Internet from the Categories list
    4. Uncheck Display PDF in browser
    5. Press OK

    you can also disable the Adobe plugin in Chrome, which will force Chrome to download the PDF.

    It's under chrome://plugins.

    but as you said its latest chrome browser then check is chrome PDF view visible in plugin if Yes disable it too.

    • Disable "Chrome PDF Viewer" or unmark always allowed to run check box try both

提交回复
热议问题