Home > Blockchain >  Python Selenium find xpath or any path for this button
Python Selenium find xpath or any path for this button

Time:10-12

How to find the right xpath or any methode to get this button to click?

Button Name: Add owmner

enter image description here

What I tried so far:

    WebDriverWait(self.browser, 10).until(EC.presence_of_element_located((By.XPATH, "/html[1]/body[1]/div[1]/div[4]/main[1]/div[3]/div[2]/section[3]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[1]"))).click()
    WebDriverWait(self.browser, 1).until(EC.presence_of_element_located((By.CLASS_NAME, "azc-toolbar-item azc-toolbarButton fxs-commandBar-item fxs-vivaresize"))).click()
    WebDriverWait(self.browser, 1).until(EC.presence_of_element_located((By.ID, "_weave_e_1305"))).click()
    WebDriverWait(self.browser, 1).until(EC.presence_of_element_located((By.XPATH, "/html[1]/body[1]/div[1]/div[4]/main[1]/div[3]/div[2]/section[3]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[1]/div[1]/div[1]/*[name()='svg'][1]"))).click()
    WebDriverWait(self.browser, 1).until(EC.presence_of_element_located((By.XPATH, "/html[1]/body[1]/div[1]/div[4]/main[1]/div[3]/div[2]/section[3]/div[1]/div[2]/div[1]/div[1]/ul[1]/li[1]/div[1]/div[2]"))).click()

HTML Logs

enter image description here

CodePudding user response:

Please try this:

WebDriverWait(self.browser, 10).until(EC.visibility_of_element_located((By.XPATH, "//div[contains(@class,'azc-toolbarButton-label') and(contains(text(),'Add owners'))]"))).click()
  • Related