Allow access to the Chrome Filesystem API with Selenium using Python

Asked

Viewed 241 times

-1

I need a little help here! I need to set up selenium using the webdrive to click on a Chrome pop-up window. I’ve tried several alternatives I found, but none of them work. A company security policy restricts some settings, but the automatic download is possible, but the automatic download runs only after clicking Allow (Allow). Chrome asks "Store files on this device" with Allow or Lock options. As per image.

Armazenar arquivos neste dispositivo

That was the code used:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time


option = Options()
option.add_argument("--disable-infobars")
option.add_argument("start-maximized")
option.add_argument('--ignore-certificate-errors')
option.add_argument("--disable-extensions")
option.add_argument('--disable-download-notification')
option.add_experimental_option("useAutomationExtension", False)
option.add_experimental_option("prefs", {
                "safebrowsing.enabled": True, 
                "profile.default_content_setting_values.notifications": 1, 
                "profile.default_content_setting_values.geolocation": 1})

wd = webdriver.Chrome(chrome_options=option, executable_path='C:\\Users\\Documents\\webdriver\\chromedriver.exe')
wd.get('http://websiteintranet.com.br')

1 answer

0


This is a Chrome security measure when a website tries to use Chrome Filesystem API.

If you have full confidence in the website you are accessing, you can bypass that pop-up by starting Chrome with the flag --unlimited-storage

option.add_argument("--unlimited-storage")
  • it worked, it was just that!!! Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.