Python Selenium Chrome Webstore Add Extension Popup Window Problem

230 Views Asked by At

How can I get the xpath of the window that appears when adding a extension in the chrome web store in Python Selenium. I know there are many ways to define extension. However, I need to add a plugin from the Chrome webstore.

Thank you very much in advance for your help.

I need to find the xpath of it.

chrome webstore add extension find xpath problem

I want to find the add extension xpath.

2

There are 2 best solutions below

0
AbdeLhalimSB On

The best way to add extension and use it with selenium and chrome driver is download the extension and load it with chrome options :

  1. download the extension using this website : http://crxextractor.com/

  2. Follow that code :

    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.action_chains import ActionChains
    import selenium.webdriver
    
    chrome_options = selenium.webdriver.ChromeOptions()
    chrome_options.add_extension('EditThisCookie.crx') # Add extention to chrome driver
    driver = selenium.webdriver.Chrome(chrome_options=chrome_options)  
    driver.get("https://www.google.com/")
    driver.implicitly_wait(10)
    # Your Code here
    

That is the results

Click here to see Results

0
dony On

You have 2 ways. Switch to frame pop up or switch to iframe.