I am trying to find the xpath
of svg
next to
"//label[@class='btn btn-light p-1']/input[@value='star']
https://9qrcode.com/#link then select Design
I am trying to find the xpath
of svg
next to
"//label[@class='btn btn-light p-1']/input[@value='star']
https://9qrcode.com/#link then select Design
I hate to do such xpaths, since I agree with Eliyahu - these kind of xpaths won't be unique...but since you asked, here you go, this should work for you:
//input[@value = 'star']/parent::label[contains(@class, 'btn-light')]/preceding-sibling::label[contains(@class, 'btn-light')]/*[name() = 'svg']
//input[@value='star']/preceding::label[@class='btn btn-light p-1'][1]
This will get the preceding element before the value of star which since it's not unique will give two values.
You can use this xpath
-
(//label[contains(@class,"btn btn-light")]/*[local-name() = 'svg'])[2]
your can put your element number in replacing [2].