How click in Button with Selenium python

Issue

I want to click the configuration button, which leads to discord profile information,

enter image description here

Guys, I want to click on the gear at the bottom, how can I do this? This is my code:

option = Options()
option.add_argument("--no-sandbox")
driver = webdriver.Chrome(options=option)
driver.get("https://discord.com/channels/395582581124497408/395582581124497412")       
wait = WebDriverWait(driver, 5)              
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'a.item'))).click()
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div#contents-18-Yxp"))).click()

Can anyone help me with this problem?

Solution

you can click it with this code:

driver.find_element_by_css_selector('div'[aria-label="User settings"]').click()

Answered By – shiny

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published