[Greasemonkey] generating XPath string from dom node
Jeremy Dunck
jdunck at gmail.com
Thu Mar 16 10:31:26 EST 2006
On 3/16/06, Jonathan Buchanan <jonathan.buchanan at gmail.com> wrote:
> Further to Matt's suggestion, if you want to select a specific
> element, you'll need the offset for the case where there are multiple
> elements with the same path. Something like:
>
...
> return "//" + tagNames.reverse().join("/") + "[" + offset + "]";
You'll want to find the offset for each tag, not just the leaf.
More information about the Greasemonkey
mailing list