Your XPath expression:
This will not select the node you want.
Rather you should write:
(//*[local-name()='svg']//*[local-name()='path' and @elementargument='Subs'])[1]
You may wonder what //*[local-name='svg']//*[local-name()='path'' ....' is. Before talking about it, let me ask you some questions:
- Are you aware of the concept of XML Namespace?
- Are you aware that the node you want to click belongs to the Namespace of Scalable Vector Graphics?
- Are you aware that the node you want to click does not belong to the Namespace of XHTML?
- Are you aware that you have a node
<html xmlns="http://www.w3.org/1999/xhtml">as the ancestor of your target node? - The screenshot you provided does not show it, but most probably you would have a node
<svg xmlns="http://www.w3.org/2000/svg">as the ancestor of your target node. Am I right?
If you do not understand my questions, you need to study “XML Namespace” specification first. Otherwise you would be lost forever.
Also you would want to study XPath local-name() and name() functions:
Here is my previous post about selecting a SVG node contained in a HTML document. Please have a look.