我正在尝试使用 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)
请建议。先感谢您