Online Shopping : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

5 of 7 people (71%) answered Yes
Recently 5 of 7 people (71%) answered Yes


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'] = '';
$b->visible = 1;
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 
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.
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. :)