GetRectCheckSum> help

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Crosby

GetRectCheckSum> help

Post by Crosby » Wed Mar 03, 2004 12:13 am

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

Lumumba

Post by Lumumba » Wed Mar 03, 2004 12:44 am

Click --> here. It's a request from someone who has named him-/herself Crosby ! . He/she should have made some progress on solving that issue. Keep us updated !

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Mar 03, 2004 7:17 am

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):
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
It has been set up to be defined how long you want to wait before it quits.
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!

Lumumba

Post by Lumumba » Wed Mar 03, 2004 10:19 am

Hi Bob,
I don't expect that you change that script especially if it's running smoooothly since ages ... :wink:

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

:arrow: Another option: wget (cygwin :?: )

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Mar 03, 2004 3:50 pm

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...... :lol:
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts