Looking at the rdocs, http://wtr.rubyforge.org/rdoc/1.6.5/, have you tried
browser.frame("main").html
?
On Tue, Apr 20, 2010 at 10:51 AM, Dan Martin ummar143@shaw.ca wrote:
I am learning to navigate and scrape. I have had more success with Firewatir than Ruby mechanize, but both are poorly documented.
Current problem: logging into a site webpage, Firwatir can see the frames, but cannot access them.
browser.show_frames
There are 3 frames frame: name: topbar index: 1 frame: name: langFrame index: 2 frame: name: main index: 3 => 0..2
browser.frame(:index, 1)
=> #<FireWatir::Frame:0x1a9260c located=false how=:index what=1>
browser.frame("main")
=> #<FireWatir::Frame:0x1a90dd4 located=false how=:name what="main">
Firefox shows the webpage source [I show only the top levels] structure as:
<html>
<head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title>TITLE</title> <link rel="stylesheet" href="all.css">
<script language="JavaScript" src="WEBPAGE"></script> <script language="JavaScript">FUNCTIONS</script>
</head>
<frameset rows="63,0,*" border="0" id="frameset_ID" framespacing="0"
frameborder="no" onload="loadHomepage(1);" onunload="forceLogout();"> <frame src="/TDM/header.htm" name="topbar" scrolling="no" noresize>STUFF IN HERE</frame>
<frame name="langFrame" src="lang.html">STUFF IN
HERE</frame> <frame src="" id="main_ID" name="main" noresize>STUFF IN HERE THAT I WANT</frame> </frameset>
<noframes> STUFF IN HERE </noframes>
</html>
I cannot access any forms etc included in the frame unless I can name / access the frame. Any ideas?
Dan Martin GP Hospital Practitioner Computer Scientist ummar143@shaw.ca (204) 831-1746 answering machine always on
Roundtable mailing list Roundtable@muug.mb.ca http://www.muug.mb.ca/mailman/listinfo/roundtable