相关疑难解决方法(0)

Selenium Webdriver:如何使用 Python 下载 PDF 文件?

我正在使用 selenium webdriver 自动下载多个 PDF 文件。我得到了 PDF 预览窗口(见下文),现在我想下载该文件。如何使用 Google Chrome 作为浏览器完成此操作?

对话框

python pdf selenium automation download

11
推荐指数
4
解决办法
3万
查看次数

如何在python中使用selenium下载pdf文件

我正在尝试使用 selenium 从网站下载 pdf 文件,但我能够打开文件,但不能使用代码自动下载。

代码:

chrome_profile = webdriver.ChromeOptions()
profile = {"download.default_directory": "C:\Users\Downloads",
   "download.prompt_for_download": False,
   "download.directory_upgrade": True,
   "plugins.plugins_disabled": ["Chrome PDF Viewer"]}
chrome_profile.add_experimental_option("prefs", profile)
Run Code Online (Sandbox Code Playgroud)

请建议。先感谢您

python selenium google-chrome python-2.7

1
推荐指数
1
解决办法
6393
查看次数