xml - Unable to determine the XPATH used with nested SVG elements that do not contain IDs -


i need determine full xpath reach 3rd path element displayed here:

<div id="myid">     <div>         <svg version="1.1">             <g>                 <g>                 <g>                     <g>                         <g>                         <g>                             <path fill="green">                             <path fill="orange">                             <path fill-opacity="0.2"> 

... plus relevant closing tags.

i need use xpath in conjunction selenium-webdriver. looking @ example: selenium webdriver: clicking on elements within svg using xpath understand need need use either local-name() or name() methods interact svg element not sure how incorporate initial nested divs , reach through nested g elements no ids or other information work with.

thank in advance if able help!

you position each level:

id('myid')/div/*[1]/*[1]/*[2]/*[1]/*[2]/*[3] 

or tag name:

id('myid')/div/*[name()='svg']/*[name()='g']/*[name()='g']/*[name()='g']/*[name()='g']/*[name()='path'][3] 

or :

id('myid')//*[name()='svg']//*[name()='path' , @fill-opacity='0.2'] 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -