Disabling PDF Viewer plugin in chromedriver

前端 未结 3 1525
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 03:08

I\'m trying to batch-download a lot of files within the BlackBoard environment (used a lot on universities/schools around the world). I am able to retrieve the links where t

3条回答
  •  [愿得一人]
    2020-12-20 03:45

    Ari's answer was almost working properly. I only needed to encapsulate the plugin's name into a list:

    chromeOptions = webdriver.ChromeOptions()
    prefs = {"plugins.plugins_disabled" : ["Chrome PDF Viewer"]} # Here should be a list
    chromeOptions.add_experimental_option("prefs",prefs)
    chromedriver = "path/to/chromedriver.exe"
    driver = webdriver.Chrome(executable_path=chromedriver, chrome_options=chromeOptions)
    

    The downloading now works just fine!

提交回复
热议问题