<div class="account-container loggedIn svelte-2hymnw"><button type="button" class="text-center font-medium focus-within:ring-4 focus-within:outline-none inline-flex items-center justify-center px-5 py-2.5 text-sm rounded-lg icon-btn"><span class="sr-only">Account</span> <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="shrink-0 w-4 h-4 nav-icon" role="img" aria-label="user solid" viewBox="0 0 14 18"><path fill="currentColor" d="M7 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm2 1H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z"></path></svg></button></div>
This is the button within a div. It dont have a specific identifier.
I try already:
driver.find_element(By.XPATH,"//div[@class='account-container.loggedIn']/button[1]").click()
The span within has a text which is found, but its not clickable.
Can someone help me out ?
TIA
You can use that too. Better to use CSS_SELECTOR
.
driver.find_element(By.CSS_SELECTOR,".account-container .loggedIn .svelte-2hymnw button")