11.9 Interacting with Frames
TechniqueUse the Snoopy class (available from http://snoopy. sourceforge .net/), which supports fetching individual frames: <?php include_once 'Snoopy.class.inc'; $snoopy = new Snoopy; $snoopy->maxframes = 3; $snoopy->fetch('http://www.ispi.net/'); print "The middle frame has the following contents: "; print "\n<br>\n<br>\n<br>\n"; print htmlentities($snoopy->results[1]); ?> CommentsSnoopy , available from http://snoopy.sourceforge.net/, fetches frames for you. In the example, we initialize the Snoopy class, set the maxframes property to the maximum number of frames to fetch ( 3 ), and then use the fetch() method to fetch the page. After we've fetched the page, we access the middle frame (the frames are stored in a numerically indexed array), and print its contents. |