Where can I find documentation that describes the options that can be used with the Selenium and Chrome web browser? I want to open the link in a web browser (to get credentials), but not download the corresponding file (.pdf or .tiff or .jpeg). I am using Python 2.7, Selenium 3.0.1 and Chrome version 54.0.2840.99 (and chromedriver.exe) on a Windows 7 laptop.
# Chrome web browser. options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') #options.add_argument('--disable-download-notification') #doesn't seems to work #options.add_experimental_option("prefs", {"download.default_directory","C:\Users\xxx\downloads\Test"}) # doesn't work #options.add_experimental_option("prefs", {"download.prompt_for_download": False}) # doesn't seems to work #options.add_experimental_option("prefs", {'profile.default_content_settings': {'images': 2}})# this will disable image loading in the browser options.add_argument("user-agent="+user_agent_profile) driver_main = webdriver.Chrome(chrome_options=options) # Opening the web application portail. driver_main.get("https://my_link")
I found a lot of discussion on this topic, but none of the solutions work. For example:
add_experimental_option("prefs", {"download.default_directory","C:\Users\xxx\downloads\Test"})
not working for me
The same goes for:
add_experimental_option("prefs", {"download.prompt_for_download": False})
(I also try with "false").
While:
add_argument("user-agent="+user_agent_profile)
Seems to work!
I'm not sure I understand what is wrong
The problem I am facing is that it starts to download the file every time I open a link with the name file (1) file (2) .... file (99), then, starting at 100, a popup opens Save As window, so Iβd like to either not upload the file at all, or to be able to move it to a specific folder in the Trash.
How can I find which options can be used with add_argument and add_argument? I tried to take a look at Chrome: // about /, but did not see direct correspondence.
Many thanks.
Greetings.
Fabienne.
Dr. Fabien tarrade
source share