hi,
I am using oop with php to view a web site with many pages.There is 4 buttons for navigation from page to page. Here is my code:
1 //create a browser object:
2 $b = new COM("InternetExplorer.Application");
3 //navigate to page
4 $serv = 'http://www...../*.asp?MyCode=97';
5 $b->visible = 1;
6 $b->navigate($serv);
7 //wait for the page to be completly loaded
8 $i=0;
9 while ($b->readyState!=4) {
10 $i++;
11 }
12 //create a document object:
13 $doc = $b->document;
14 // Get buttons objects in an array
15 $btn = $doc->getElementsByName('PagingMove');
16 // Simulate a click on the next button (">")
17 $btn[2]->click();
18 $j=0;
19 while ($b->readyState!=4) {
20 $j++;
21 }
22 echo $j";
23 //create a new document object:
24 $newdoc = $b->document;
.....
up to line 17 all is ok and if using command line, the new clicked page appears on the ie browser. But I dont know how to implement a new browser object to embed the new clicked page.
The $b browser object is not refreshed after line 17 and the $newdoc is not refering to the new page but still to the old one.
My questions :
1-- How to implement the new page in a browser object (the link is an asp one so there is no transparent URL)
2 --How to transfer the content of the new clicked page to a file for example?
Many thanks for you all
Arachaz
Simulate click and get new page contents
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Can you do everyone here a favor and use the
Code: Select all
bbcode tags? It is really hard to read your code when it is just plain text on the screen. Thanks.- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
for my sake
Code: Select all
1 //create a browser object:
2 $b = new COM("InternetExplorer.Application");
3 //navigate to page
4 $serv = 'http://www...../*.asp?MyCode=97';
5 $b->visible = 1;
6 $b->navigate($serv);
7 //wait for the page to be completly loaded
8 $i=0;
9 while ($b->readyState!=4) {
10 $i++;
11 }
12 //create a document object:
13 $doc = $b->document;
14 // Get buttons objects in an array
15 $btn = $doc->getElementsByName('PagingMove');
16 // Simulate a click on the next button (">")
17 $btn[2]->click();
18 $j=0;
19 while ($b->readyState!=4) {
20 $j++;
21 }
22 echo $j";
23 //create a new document object:
24 $newdoc = $b->document;