How Do I Use XPath Following Sibling to Target the Next Element? or Struggling with XPath Following S

20 Replies, 1755 Views

"Struggling with XPath Following Sibling—Any Tips for Selecting the Right Node?"

Hey folks!

So I’m trying to use xpath following sibling to grab the next element after a specific node, but it’s not working like I expected.

For example, I’ve got something like:
`//div[@class='item']/following-sibling::div`
But it’s either picking up too much or nothing at all. Am I missing something obvious?

Any tips or tricks to make xpath following sibling behave? Maybe a clearer example would help?

Thanks in advance! 🙏

(Also, if you’ve got a better way to do this, I’m all ears!)

Messages In This Thread
How Do I Use XPath Following Sibling to Target the Next Element? or Struggling with XPath Following S - by - 06-11-2024, 12:56 AM



Users browsing this thread: 1 Guest(s)