title: Cannot Download PDF's Using Selenium/Python 3.x, But It works When I do it Manually
body: <p>I read through a ton of answers to this query of mine but couldn't find anything specific. Hence asking here</p>
  <p>Here's the scenario, On a webpage, when I click a download button, it downloads a PDF file correctly, On the browser, I have set the Firefox preferences to save the file rather than open in preview.</p>
  <p>However, when I run my selenium/Python script, the download keeps opening in the preview, there are other PDF downloads on the page and they work fine. Upon inspecting both the download buttons, the only difference I see is the one that does not download has a relative URL in its href value.</p>
  <p>I am also using the following firefox options settings in my script, but with no help. Please guide me in the right direction. Thanks in advance!</p>
  <h1>**************************</h1>
  <pre><code>fp = webdriver.FirefoxProfile()
  fp.set_preference(&quot;browser.download.folderList&quot;, 2)
  fp.set_preference(&quot;browser.download.manager.showWhenStarting&quot;, False)
  fp.set_preference(&quot;browser.download.dir&quot;, 'Path to Save The file')
  fp.set_preference(&quot;pdfjs.enabledCache.state&quot;, False)
  fp.set_preference(&quot;browser.helperApps.neverAsk.saveToDisk&quot;, &quot;application/pdf&quot;)
  fp.set_preference(&quot;pdfjs.disabled&quot;, &quot;true&quot;)
  
  # disable Adobe Acrobat PDF preview plugin
  fp.set_preference(&quot;plugin.scan.plid.all&quot;, &quot;false&quot;)
  fp.set_preference(&quot;plugin.scan.Acrobat&quot;, &quot;99.0&quot;)
  self.driver = webdriver.Firefox(firefox_profile=fp,executable_path=&quot;path to my geckodriver&quot;)
  self.driver.get(&quot;url&quot;)
  </code></pre>