What is the xpath value of my special case

Viewed 44

This is the inspect picture of a webpage, enter image description here,

as we can see, this value:

//div[contains(text(), 'Interface Settings - wan')]/../following-sibling::div[1]/div[1]/div[4]/div/div[2]/div/div/div

is xpath-ed to the yellow-color div part. Can someone help me how to xpath to its child path area in this case ?

So far I have tried such:

//div[contains(text(), 'Interface Settings - wan')]/../following-sibling::div[1]/div[1]/div[4]/div/div[2]/div/div/div/svg/path

but it does not work for me.

Thanks,

Jack

1 Answers

In general svg tags can be located as:

//*[name()='svg']

or

//*[local-name()='svg']

For your specific case, you could implement the same

//div[contains(text(), 'Interface Settings - wan')]/../following-sibling::div[1]/div[1]/div[4]/div/div[2]/div/div/div//*[name()='svg']

Having said that, I would recommend you to use relative xpath rather than absolute xpath.

Related