Quiero habilitar el indicador “allow-insecure-localhost” de selenium.
¿Cómo puedo hacerlo?
Selenio: 3.12.0, Python: 3.6.5
Código de creación del controlador Chrome:
def create_driver(): options = Options() if sys.platform == "darwin": options.binary_location = '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary' options.add_experimental_option("detach", True) options.add_argument('allow-insecure-localhost') # I tried to be enable, but it does not affect to chrome. if sys.platform == "win32": chromedriver_path = r".\chromedriver" else: chromedriver_path = "../chromedriver" driver = webdriver.Chrome(chromedriver_path, chrome_options=options) return driver
Parece que estabas bastante cerca. De acuerdo con la documentación, --allow-insecure-localhost
debe precederse de la siguiente manera:
options.add_argument('--allow-insecure-localhost')
--allow-insecure-localhost
: permite ignorar los errores TLS / SSL en localhost (sin intersticial, sin locking de solicitudes)