Clicking on svg using selenium python

后端 未结 2 1830
执念已碎
执念已碎 2020-11-30 13:20

svg icon is clickable.

2条回答
  •  暖寄归人
    2020-11-30 14:14

    To click() on the svg icon you can use the following solution:

    driver.find_element_by_xpath('//div[@class="some-class"]/*[name()="svg"][@aria-label="Search"]').click()
    

    You can find a couple of relevant discussions in:

    • How to click on SVG elements using XPath and Selenium WebDriver through Java
    • Unable to locate SVG elements through xpath on Kendo UI chart

提交回复
热议问题