[Greasemonkey] Re: evaluate and XPCNativeWrapper in 0.6.4

Vincent Chute vincent_chute at hotmail.com
Tue Jan 31 23:38:11 EST 2006


From: Bruce Perry <bhrperry at comcast.net>
...
>Well, going for h2 was my attempt to get XPath to work at all.  I'm new to 
>that too.
I recommend the XPather extension for learning / developing with XPath. [ 
http://xpath.alephzarro.com/ ]
That along with the Javascript Shell [ http://www.squarefree.com/shell/ ] 
are my 2 favourite tools for developing greasemonkey scripts.

>What I'm actually trying to do is get a bunch of links that are children of 
>h4 nodes.
>The h4 nodes all come after a specific h3 node (no ID, but will contain 
>specific text).
>All this is contained in a div tag with the id of 'sidebar', but this 
>situation probably won't be
>duplicated elsewhere on the page.  I certainly don't expect anyone to wade 
>through all
>that for me.  I'll build more specific XPath expressions and narrow in on 
>what I really want.

If you want to work it out yourself skip the rest of the message but...
.
.
.
.
.
.
I would guess it would be something similar to 
"//div[@id='sidebar']//h4[preceding-sibling::h3[text()='SpecificTextGoesHere']]//a"

(It took longer to type than think up.) :-)




More information about the Greasemonkey mailing list