I have this html code :
<button>
<svg aria-label="Options">
<circle></circle>
</svg>
</button>
I need to select the button to click it like this :
browser.find_element_by_xpath('//svg[@aria-label="Options"]/parent::button').click()
I've also tried this :
browser.find_element_by_xpath('..//button/svg[@aria-label="Options"]').click()
But it says :
NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"..."}
How to select this button please ? I cannot show the all code, the button is not reachable easily because it has random classes... Thanks !
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.