小编use*_*270的帖子

如何在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
查看次数

标签 统计

google-chrome ×1

python ×1

python-2.7 ×1

selenium ×1