I am trying to use Selenium webdriver to automate some of the work. My automation includes downloading some .msg outlook email file from the web attached by somebody else. Downloading the .msg file prompted a warning from Chrome saying "This type of file can harm the computer...". Using the ChromeOptions to add argument --safebrowsing-disable-download-protection does not work, the download still prompted the warning with the argument added into the chrome options, any help will be appreciated.
Code trial:
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--safebrowsing-disable-download-protection')
driver = webdriver.Chrome(chrome_options=chrome_options)
printing the chrome_options.arguments
shows that the '--safebrowsing-disable-download-protection'
is added into the arguments, but when I started to download the .msg files using Selenium, I still receive the same warning.
Something to note, when i manually run chrome.exe via cmd using the '--safebrowsing-disable-download-protection', downloading without warning works.
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:
--safebrowsing-disable-download-protection
is supposed to be cleaned up as a command flag to make download safebrowsing protect a default behavior.--safebrowsing-disable-download-protection
is no more effective.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With