So, if I have something like this:
//div[@class='artist']/p[x]/text()
x can be either 3, or 4, or even another number. Fortunately, if what I'm looking for is not at 3, I can just check the null value and continue until I find the text. The problem is that I would rather know that every time I am going to the right element. So I tried this:
div[@class='people']/h3[text()='h3 text']/p/text()
since after <h3>h3 text</h3>will always be <p>. However, this never returns anything and usually results in an error. If I remove / p, I get the text "h3 text".
Anyway, how do I get <p>directly after <h3>?
By the way, I am using HTMLCleaner in Java for this.
source
share