[Greasemonkey] XPATH pattern
Chris Hayes
chayes at antenna.nl
Sat Sep 23 02:18:32 EDT 2006
I am rebuilding a html page (phpfreakz.nl).
The messages have this basic setup (very simplified)
<table>
<tr> <td> title
<tr> <td> entered : data
<tr> <td> modified: date // this table row is only added
when modification made
<tr> <td> <div><div><span></span><hr>
<tr> <td> CONTENT
<tr> <td> varying buttons
</table>
Now I want to use a pattern to grab the CONTENT.
There are no name's or id's to use to get there quickly.
Since the modified date is sometimes present, i should not use
.//TABLE/tr[4] because it can also be .//TABLE/tr[5]
I hope to catch it by saying:
give me the TR content of the TR that comes after the TR with the HR in it.
Is anybody experienced with such reversing search patterns?
I am thinking in the direction of
.//TABLE/TR//HR/parent::/following-sibling::
but here I am only going one parent up, which is maybe not the TR: can I
go up and specify to go up to TR?
(The option to do a test on innerHTML is inconvenient in the script I am
using, though not impossible)
Alternatives: the TR with the HR in it has colspan=2. Maybe that's a
way to catch it!
More information about the Greasemonkey
mailing list