Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating XPATH for svg tag

Below is the html for SVG, pls help me with creating XPATH for same

<svg data-reactid=".1q.0.3.1.0" version="1.1" class="svg-connector">
   <circle data-reactid=".1q.0.3.1.0.0" r="7" cy="11" cx="11" class="inner-circle"/>
</svg>
like image 617
Altamash Shaikh Avatar asked Feb 28 '18 07:02

Altamash Shaikh


1 Answers

For svg nodes you need to use below syntax:

//*[name()="svg" and @class="svg-connector"]

This is because common HTML nodes and svg nodes belongs to different namespaces

like image 147
Andersson Avatar answered Oct 07 '22 10:10

Andersson