ChromeOption '--safebrowsing-disable-download-protection' doesn't disables the download warning in Chrome version 67.x
As per your code trials as you are trying to implement --safebrowsing-disable-download-protection
through ChromeOptions()
but it is worth to mention the following points:
- As per Remove kSbDisableDownloadProtection flag to make download safebrowsing protect a default behavior
--safebrowsing-disable-download-protection
is supposed to be cleaned up as a command flag to make download safebrowsing protect a default behavior. - The fix was dependent on Replace safe browsing DB and update protocol with Pver4 which was marked as fixed as no issues have been reported since full launch.
- Subsequently Remove kSbDisableDownloadProtection flag to make download safebrowsing protect a default behavior was also marked as fixed.
- The fix Enable PVer4 by default for desktop platforms establishes the fact that the ChromeOption
--safebrowsing-disable-download-protection
is no more effective.
Conclusion
As per the points mentioned above the ChromeOption --safebrowsing-disable-download-protection
is no more an effective/valid ChromeOption and should be handled by PVer4 by default for desktop platforms.
You can try this:
from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionschrome_options = Options()chrome_options.add_experimental_option("prefs", { "download.default_directory": r"C:\Users\downloads", "download.prompt_for_download": False, "download.directory_upgrade": True, "safebrowsing.enabled": False})driver = webdriver.Chrome(chrome_options=chrome_options)
This should work
driver = webdriver.Chrome(chromeDriver, options=options) params = {'behavior' : 'allow', 'downloadPath':r"C:\Users\downloads"} driver.execute_cdp_cmd('Page.setDownloadBehavior', params)