Click a dropdown using Selenium in Python Jupyter Notebook

Viewed 68

How can I click a button with the below HTML? When clicking the button it provides a dropdown and multiple options (but below you can see it only shows "all registries").

I tried with no luck many versions of: driver.find_element_by_id() and driver.find_element_by_class_name()

enter image description here

1 Answers

You can click on all registries with the below code :

xpath :

//strong[text()='all registries']/../../..

use it in code like this :

wait = WebDriverWait(driver, 10)
wait.until(EC.element_to_be_clickable((By.XPATH, "//strong[text()='all registries']/../../.."))).click()

Imports :

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
Related