1

Can someone please assist with the following issue?

I have map with more than 2000 elements loaded, but only one of them (which is currently visible) has the element 'path' with an attribute d different than zero. For easier understanding, refer to the following screenshot:

enter image description here

Tried with this: SVG & Path finding, but did not find what I was looking for.

And having this XPath:

//div[@id="map"]//div[contains(@class,"map")]//div[@class="leaflet-pane"]//div[@class="leaflet-pane2"]//*[name()='svg']//*[name()='path' and @d="M0 0"]

which finds all of them (2000).

What I am looking for is something like this (though I could not find the correct solution) - deliberately just added end of Xpath.

In summary, I need the d attribute (inside path) to not contain the value zero:

//*[name()='svg']//*[name()='path' and @d(contains,"125")]

Please assist, and thank you in advance.

neopythe
  • 107
  • 1
  • 2
  • 10
Zoran
  • 491
  • 7
  • 22

1 Answers1

1

According to your descriptions you are looking for locator where d attribute value is not equals to M0 0.
This can be translated to XPath with not operator.
Please try this:

//div[@id="map"]//div[contains(@class,"map")]//div[@class="leaflet-pane"]//div[@class="leaflet-pane2"]//*[name()='svg']//*[name()='path' and(not(@d="M0 0"))]
Prophet
  • 32,350
  • 22
  • 54
  • 79