Proxy Community
How Do I Use XPath Following Sibling to Target the Next Element? or Struggling with XPath Following S - Printable Version

+- Proxy Community (https://proxycommunity.com/forum)
+-- Forum: Use Case (https://proxycommunity.com/forum/forum-use-case)
+--- Forum: Web Scraping (https://proxycommunity.com/forum/forum-web-scraping)
+--- Thread: How Do I Use XPath Following Sibling to Target the Next Element? or Struggling with XPath Following S (/thread-how-do-i-use-xpath-following-sibling-to-target-the-next-element-or-struggling-with-xpath-following-s)

Pages: 1 2 3


“” - phantomCircuitX - 05-04-2025

Had this exact issue last week! The problem was that the sibling wasn’t *directly* after. Try:
`//div[@class='item']/following-sibling::*[local-name()='div'][1]`

Also, [this XPath cheatsheet](https://devhints.io/xpath) saved my life.