Hi, I'm trying to detect whether IE is done loading a page. The best I can think of is to watch for the Status line to indicate "Done" with GetRectCheckSum>. My problem is, I can't get the function to work.
Let>cs=0
GetRectCheckSum>510,233,515,238,cs
if>cs=0,Nope
MessageModal>%cs%
GoTo>END
Label>Nope
MessageModal>Nope
Label>END
The above snippet always returns "Nope", though I'd hoped it would tell me the checksum for the rectangle. I must be doing somthing dumb? Please help!
Thanks,
Crosby
GetRectCheckSum> help
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Have you tried to do a View Source on the web page? You will not be able to do View Source until page is done loading. So create a loop trying to View Source, every 1 second, and loop until can do. Now closed the View Source window and you know your page is done loading and ready to use.
I have done this in the past, but have not time to do the code right now.
Here is some code I have available right now that was set up to do on Netscape (version 4.79 I think):
Sorry, no time to clean it up, but it is functional, runs every week to do some web-scraping. Should give you some ideas on how to do this.
I have done this in the past, but have not time to do the code right now.
Here is some code I have available right now that was set up to do on Netscape (version 4.79 I think):
It has been set up to be defined how long you want to wait before it quits.Label>MacroVariables
//Set macro variables
CapsOff
Let>Page=1
Let>SK_DELAY=10
//===================================
//Search Delay is number of seconds between Searches. Value of 3 allows 20 Searches per minute.
Let>SearchDelay=3
Let>MaxSearches=%MaxSeconds%/%SearchDelay%
//Next line is to initialize Searches counter.
Let>Searches=0
Label>Start
//Delete old temp*.htm files
DeleteFile>%SaveHtmPath%temp*.htm
Wait>2
Label>NewStuff
Run Program>"%Netscape%" %URL%
//
// Remark>*** Tests to see if page is done loading in netscape by trying to view source****
// Remark>*** code every SearchDelay seconds. for maximum of MaxSearches searches.****
Wait>10
Label>NextCheck
Add>Searches,1
If>%Searches%=%MaxSearches%,CouldNotFindInTime
If>%Searches%>%MaxSearches%,CouldNotFindInTime
//
// Remark>- Tests for presence of Netscape and sets focus ----------
IfWindowOpen>Netscape*,Loading
//Goto>CouldNotFindNetscape
Goto>NewStuff
Label>Loading
IfWindowOpen>%Window1%*,Set1
Goto>CouldNotFindWindow
Label>Set1
SetFocus>%Window1%*
//
// Remark>- Tries to bring up source window, cycles back if not found----
// Press Shift key to temporarily bypass Pop-Up Stopper
Press SHIFT
Wait>.5
Press ALT
Wait>.5
Send Character/Text>vu
Release ALT
Release SHIFT
Wait>3
IfWindowOpen>Source of:*,FoundSourceWindow
Goto>NextCheck
//
// Remark>*** Found Source window, A page has finished loading. *****
// Remark>*** Closes the source window and goes to end, so your script can now continue***
Label>FoundSourceWindow
Wait>1
SetFocus>Source of:*
Press ALT
//SetFocus>Source of:*
//Send Character/Text> c
Press F4
Release ALT
//Message>Page Done Loading!
Goto>Found
//
Label>ResultMessages
// Remark**** Situation: Timed out waiting for page to finish loading ****
Label>CouldNotFindInTime
MessageModal>Could not find in %MaxSeconds% seconds.%CRLF%%CRLF%(Page did not finish loading?)%CRLF%%CRLF%Does Pop-Up Stopper need to be disabled?
Goto>End
Sorry, no time to clean it up, but it is functional, runs every week to do some web-scraping. Should give you some ideas on how to do this.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Hi Bob,
I don't expect that you change that script especially if it's running smoooothly since ages ...
But if something comes along which looks close to that task - check this out !
Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and a busload of other useful tricks. Open source & freeware.
Platform: Windows/Linux/True64/Solaris/IRIX/HP-UX ...
Mission completed:
I had to download a report from an intranet (helpdesk) page once a day.
Direct access to the assigned DB wasn't possible.
With curl we "greped" the page content using the commandline (regardless that I had to to login with user/pw).
Curl - the Webpage
Another option: wget (cygwin
)
I don't expect that you change that script especially if it's running smoooothly since ages ...

But if something comes along which looks close to that task - check this out !
Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and a busload of other useful tricks. Open source & freeware.
Platform: Windows/Linux/True64/Solaris/IRIX/HP-UX ...
Mission completed:
I had to download a report from an intranet (helpdesk) page once a day.
Direct access to the assigned DB wasn't possible.
With curl we "greped" the page content using the commandline (regardless that I had to to login with user/pw).
Curl - the Webpage


- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
thanks for suggesting those tools lumumba.....will look into them.
This is only the front end to the actual work. But you are correct, what is not broken won't be fixed, too many other issues to take care of.
Not pretty,:oops: but it functions......
This is only the front end to the actual work. But you are correct, what is not broken won't be fixed, too many other issues to take care of.
Not pretty,:oops: but it functions......

Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!