[Python] Selecting a certificate in the CryptoPro Extension for Code Browser Plug-in window...

Discussão em 'Python' iniciado por Stack, Outubro 5, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to automate work with resources that require authentication when logging in with a certificate. I use python + selenium==4.24.0. Authentication takes place using the CryptoPro Extension for Code Browser Plug-in browser extension https://chromewebstore.google.com/d...-for-c/iifchhfnnmpdbibifmljnfjhpififfog?hl=ru.

    image here

    An authorization window pops up when you log in. I can't figure out how to manage this window in selenium. I need to select a user and click ok. The window pops up before the page loads.

    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service

    browser_app = '/usr/bin/chromium-gost'
    chrome_driver = 'data/chromium_gost/chromedriver'

    options = webdriver.ChromeOptions()
    options.binary_location = browser_app


    driver=webdriver.Chrome(options=options, service=Service(chrome_driver))
    driver.get('https://resourse/address')



    I tried to use alert and Mouse actions

    https://www.selenium.dev/documentation/webdriver/interactions/alerts/ https://www.selenium.dev/documentation/webdriver/actions_api/mouse/

    But it didn't help the page continues to wait for action

    Continue reading...

Compartilhe esta Página