I have an svg
element with multiple g
tags inside it. Typically, when I select a tag by name, I get a list of all tags on the page. For example, this returns a list of Selenium WebElement
instances:
browser.find_elements_by_xpath('//a')
But when I try to select all the g
tags inside my svg
element, I only get the first element returned. For example:
browser.find_element_by_xpath('//*[name()="svg"]/*[name()="g"]')
And here my markup:
<svg xmlns="http://www.w3.org/2000/svg">
<g>...</g>
<g>...</g>
<g>...</g>
...
</svg>
How can I select all the g
tags?