Entry
How can I use InternetExplorer.Application to access the contents of specific frames?
Mar 20th, 2008 17:04
ha mo, Jason Horsley,
I think the question needs more details.
I make an object:
$b = new COM("InternetExplorer.Application");
then I navigate to a page
$c['server'] = 'http://www.mypage.com/';
$b->visible = 1;
$b->navigate($c['server']);
then once the page is completly loaded ($b->readyState==4)
I try to access the frames
echo $b->Document->frames->length; //prints out '2' since there are two
frames
echo $b->Document->frames->item(0); //prints out 'Object'
trying to access properties or methods of the item(0) object causes my
program to crash.
ANSWER:
-------
I think I had too many pointers (->) in my original code:
echo $b->Document->frames->item(0)->Document;
would crash
but with this code:
$a = $b->Document->frames->item(0);
echo $a->Document->body->innerHTML;
I can get the html of the first frame. :)
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com