Hello Terry,
On 5/23/06, Terry Brooks <tabrooks u.washington.edu> wrote:
>
>
> I am trying to write a Greasemonkey script for a
frameset page and would
> like to access the content in a subframe. I'm having
trouble
> constructing an XPath that will take me from the
frameset page down into
> the subframe page. The XPath into the frameset page
is:
> /html/frameset/frameset/frame[1] and the XPath into the
subframe is:
> /html/body/p[1]/a[1]. How does one stitch these two
together so I can
> write a single XPath from the frameset page right down
into the subframe
> page?
>
I don't think you can access the content of a sub-frame
with an XPath like
that.
You probably have to use something like....
var iframe_element =
document.getElementById("the-id-of-the-iframe");
var iframe_document = iframe_element.contentWindow.document;
And then once you have the "document" of that
iframe then you can apply you
XPath's to that.
See ya
--
Charles Iliya Krempeaux, B.Sc.
charles reptile.ca
supercanadian gmail.com
developer weblog: http://ChangeLog.ca/
____________________________________________________________
_______________
Make Television http://maketelevision.com/
_______________________________________________
Greasemonkey mailing list
Greasemonkey mozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
|