I want to download pdf file from this link: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9152778.
Followed by instruction Selenium Webdriver: How to Download a PDF File with Python? I created code like this:
url = 'https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9152778'
options = Options()
options.headless = False
options.add_experimental_option('prefs', {
"download.default_directory": outdir,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"plugins.always_open_pdf_externally": True,
}
)
chromedriver = driver_path
driver = webdriver.Chrome(chromedriver, options=options)
driver.get(url)
The selenium can successfully open the browser. However it doesn't download the pdf but showing the page like this:
I have to click on the Open button to start download. The html doesn't show any information about the button also.
Could anyone tell me how to modify the code to download pdf from this site? The script has no problem when given pdf url from other sites! Thanks in advance!