From: Marc G. <mgu...@ya...> - 2005-03-03 10:19:33
|
you just need to access the enclosed page, for instance with: final HtmlInlineFrame iframe = (HtmlInlineFrame)page.getHtmlElementById("i_frame"); final HtmlPage containedPage = (HtmlPage) iframe.getEnclosedPage(); Marc. nikola wrote: > hi, > > I want to access iframe content as I can acsess "main" > page content for example: > > main.php page > > <html> > <head><title>title</title></head> > <body> > some content<br> > <a href="link.php">link</a> > <iframe id="i_frame" name="i_frame" > src="main.php?content_id=1"></iframe> > </body></html> > > ... now if I want to get link or iframe on this main > page, I know how to do it... > final HtmlInlineFrame iframe = > (HtmlInlineFrame)page.getHtmlElementById("i_frame"); > > but i want to know if there is a way to access content > of this iframe page, how can I access > main.php?content_id=1 from main.php in some way > referencing iframe, to get elements of that second > page... > > ... I know I can get srcAttribute of iframe, and then > load main.php?content_id=1 to a WebClient, but then I > can't access elements of that page, for example if > there is link I can't get it > > final HtmlAnchor anchor = > second_page.getAnchorByHref(" some_href"); > > ... I get an error ElementNotFound ... > > > > > > > __________________________________ > Celebrate Yahoo!'s 10th Birthday! > Yahoo! Netrospective: 100 Moments of the Web > http://birthday.yahoo.com/netrospective/ > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |