1

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

user3595231
  • 711
  • 12
  • 29

1 Answers1

1

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.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38