Jump to content

Web Page Load Completion


Recommended Posts

Ok folks, have been using for around a week, and have greatly appreciated all the posts I've read.

Please be easy on me :D

I have this web page that is using dropdown boxes, and the only way I can access the correct selection is with Mozilla to find some text after, back-tab to the dropdown and then type out the text, etc...

Because of the above, I've got to use Mozilla as I could not find a way around the issue with IE(which is supposed to be the browser I use for this, however I use Mozilla as my primary browser, and the swithing to Mozilla is not an issue)...

In regard to Mozilla - and hence my "major" problem:

No matter what I try, the icon/pixel work-around, the search for text/copy/see if you found it on the page, etc., to find out if a page is done loading prior to my sending input - Nothing works.

This is a frames based page with a java applet in the first frame, form in the second and text in the third.

No matter what text I try to search for, and copy to test if matched, Mozilla finds it, but a !c (copy) does not work. I know the syntax for the send command is working as I've got it to work on several other web pages - yahoo to name one, but with this frames page, I can't seem to copy the found text - if in fact that is the only way to determine if a web page has fully loaded in Mozilla.

Any comments, suggestions, input greatly appreciated.

Cheers!

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

SweatyOgre,

Thanks for the feedback.

I just tried to look at the cursor changing, and it does in fact change to the hourglass but only depending on which frame it is hovering over...

I wish there were a way to access the statusbar text of Done in Mozilla...

I'll try your cursor suggestion above and see if I can move it to the specific frame location that I'm waiting to load, however I have a funtion that I was planning on calling, and because follow on pages have different frames in different positions, uhggg :D

Thanks Again - I'll try it out and let you know...

Link to comment
Share on other sites

SweatyOgre,

Thanks for the feedback.

I just tried to look at the cursor changing, and it does in fact change to the hourglass but only depending on which frame it is hovering over...

I wish there were a way to access the statusbar text of Done in Mozilla...

I'll try your cursor suggestion above and see if I can move it to the specific frame location that I'm waiting to load, however I have a funtion that I was planning on calling, and because follow on pages have different frames in different positions, uhggg :huh2:

Thanks Again - I'll try it out and let you know...

I recently used AutoIt to automate some surfing using Mozilla-firefox.

When a page is loading, there is a small blue progress bar in the lower-right on the status line. Just to the left of the blue bar is a separator column that is only visible when the progress bar is progressing. :D I ended up using PixelGetColor to test if that seperator was present to determine if Firefox was busy doing something.

I used a fragment like this:

AutoItSetOption("PixelCoordMode",0)

; Pause while Firefox is busy
$Val = PixelGetColor(657,721)
While $Val <> 13160660
  Sleep(100)
  $Val = PixelGetColor(657,721)
WEnd

; Firefox is done loading - do other stuff here

I used the relative coordinates of 657,721 for my colour test. It is probably different in Mozilla proper vs. Firefox.

Hope this helps!

John

Link to comment
Share on other sites

Sorry to not answer your question, but you mentioned IE. I searched for information on how to do this in IE, but I couldn't find anything.

The problem is that for pages with frames, it'll say "Done" even if the page isn't finished loading. Is there anyway to get around that, or do you just have to Sleep()?

Link to comment
Share on other sites

napgravy,

Thanks for your input. Have gotten to work with Mozilla 1.4 Mozilla/5.0 on w2k, however both window size and resolution are impact successful loading of the web page. Great workaround however!

In regard to Firefox, would think the same would apply as with Mozilla. Also check out the updates to Firefox, and while I will get it and most likely use it, I need to wait a bit until some of the glitches are worked out..

Thank You Again however.

Link to comment
Share on other sites

WLGades,

Thanks for your comment, so far the only way I've been able to get either IE or Moziilla to allow me to "prove-true" that a page has loaded entirely, is with the suggestion by napgravy above - however unless I start to look at resolution of the pc running this, browser window size and full screen vs. normal, etc., I'm still stuck...

Due to network response times, CPU usage, etc., I have gotten sleep to work, but it never can prove that a web page was fully loaded - with all frames.

Pending time, I might try to see how Opera controls mouse images and see if in fact that can handle...

Again - thank you for your comments.

Link to comment
Share on other sites

Instead of using static relative coordinates for your detection of that color to the left of the status bar, how about using coordinates relative to the size of the window? The bar is always at the bottom X pixels of the browser, so as long as the browser stays consistant you could check the pixel at coordinates (<WINDOW_HEIGHT> minus <SOME_NUMBER>, <X_VALUE>) . This would give the same relative position on the browser's status bar regardless of how large the window is.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Sorry to not answer your question, but you mentioned IE.  I searched for information on how to do this in IE, but I couldn't find anything. 

The problem is that for pages with frames, it'll say "Done" even if the page isn't finished loading.  Is there anyway to get around that, or do you just have to Sleep()?

One trick I do is to send

^a

sleep(1000)

^c

until certain text appears in the clipboard

Sloppy but effective

Rick

Link to comment
Share on other sites

tutor2000: Problem is, that also only works if the page has finished loading in all its frames, and you're in the correct frame.

That will work you just have to send a tab as well. Just keep sending a tab everytime you send your ^a sleep ^c

I use this method myself in my submitbyrick submission thingie

Rick

Link to comment
Share on other sites

If you use autoItX with wsh together with IE, you can check the readystate property of the IE ActiveX Object.

-------- with Jscript ------------

var ie = new ActiveXObject("internetexplorer.application");

ie.visible =false;

ie.navigate ("http://www.yahoo.com/);

while ( ie.readystate != 4 ){

WScript.sleep (10);

}

--------

Link to comment
Share on other sites

If you use autoItX with wsh together with IE, you can check the readystate property of the IE ActiveX Object.

-------- with Jscript ------------

  var ie = new ActiveXObject("internetexplorer.application");

  ie.visible =false;

  ie.navigate ("http://www.yahoo.com/);

  while ( ie.readystate != 4 ){

      WScript.sleep (10);

  }

--------

Now I still byte at vbs and more so with jscript

So do you need a wend or will that scrip do it?

Rick

Link to comment
Share on other sites

I'm assuming JSCript works like most programming languages, in that all you need is a set of curly braces {} to mark the body of the while loop.

But there's a while statement in there don't you need a while end or something to close the loop?

Rick

Link to comment
Share on other sites

But there's a while statement in there don't you need a while end or something to close the loop?

Rick

The scope of the loop officially beings at the first opening bracket { found after the body of the while condition. The end of the scope is found at the matching closing bracket }. The syntax of Java/Javascript uses brackets to denote scope's, not keywords such as Wend of EndIf.
Link to comment
Share on other sites

The scope of the loop officially beings at the first opening bracket { found after the body of the while condition.  The end of the scope is found at the matching closing bracket }.  The syntax of Java/Javascript uses brackets to denote scope's, not keywords such as Wend of EndIf.

Thanks

That'll take some getting used to. I know for next for example is used in vbscript which follows the open close loop idea as autoit does.

Rick

Link to comment
Share on other sites

All - I'd like to just say thank you for all of your responses and posts. Talk about advancing a learning curve :ph34r:

Again - Thank You

PS I've replied to most posts in the thread below, but to save time, simply did a cut and paste.

pekster

Posted: Jul 3 2004, 01:58 AM

Chain soda drinker

Group: Members

Posts: 512

Member No.: 1709

Joined: 6-May 04

Instead of using static relative coordinates for your detection of that color to the left of the status bar, how about using coordinates relative to the size of the window? The bar is always at the bottom X pixels of the browser, so as long as the browser stays consistant you could check the pixel at coordinates (<WINDOW_HEIGHT> minus <SOME_NUMBER>, <X_VALUE>) . This would give the same relative position on the browser's status bar regardless of how large the window is.

Pekster,

Thank you - was currently working on that, but I've not yet looked at monitor/board color settings to see if the color I'm using will be found...

tutor2000

Posted: Jul 3 2004, 11:21 AM

Advanced Member

Group: Members

Posts: 197

Member No.: 841

Joined: 20-February 04

QUOTE (WLGades @ Jul 2 2004, 01:54 PM)

Sorry to not answer your question, but you mentioned IE. I searched for information on how to do this in IE, but I couldn't find anything.

The problem is that for pages with frames, it'll say "Done" even if the page isn't finished loading. Is there anyway to get around that, or do you just have to Sleep()?

One trick I do is to send

^a

sleep(1000)

^c

until certain text appears in the clipboard

Sloppy but effective

Rick

Rick, thanks for your comment, wish it were that simple, out of the same three pages on a frame, one may be a java applet, and do (who only knows) with the focus of the frames, and the time it takes to load...

Had tried that same thing and it does work great with non-frames/non-java based pages as far as I've been able to test.

Thanks!

WLGades

Posted: Jul 4 2004, 04:34 AM

Member

Group: Members

Posts: 16

Member No.: 2230

Joined: 24-June 04

tutor2000: Problem is, that also only works if the page has finished loading in all its frames, and you're in the correct frame.

WLGades - wish I could have kept it that simple :(

Thanks!

hama

Posted: Jul 5 2004, 03:36 AM

Newbie

Group: Members

Posts: 4

Member No.: 2183

Joined: 23-June 04

If you use autoItX with wsh together with IE, you can check the readystate property of the IE ActiveX Object.

-------- with Jscript ------------

var ie = new ActiveXObject("internetexplorer.application");

ie.visible =false;

ie.navigate ("http://www.yahoo.com/);

while ( ie.readystate != 4 ){

WScript.sleep (10);

}

hama,

Thanks - had looked at, and may end up going that route, however not having to assure wsh, etc., is installed would be nice.

Thanks!

Valik

Posted: Jul 5 2004, 03:00 PM

Nobody ever accused me of being nice.

Group: Members

Posts: 1496

Member No.: 39

Joined: 4-December 03

QUOTE (tutor2000 @ Jul 5 2004, 06:15 PM)

But there's a while statement in there don't you need a while end or something to close the loop?

Rick

The scope of the loop officially beings at the first opening bracket { found after the body of the while condition. The end of the scope is found at the matching closing bracket }. The syntax of Java/Javascript uses brackets to denote scope's, not keywords such as Wend of EndIf.

--------------------

Save me Jebus!

I'm not not licking toads... - Homer Simpson

Nothings ever perfect, you just run out of time. Peter Jackson

Valik - thanks for your comments!

Link to comment
Share on other sites

If you use autoItX with wsh together with IE, you can check the readystate property of the IE ActiveX Object.

-------- with Jscript ------------

  var ie = new ActiveXObject("internetexplorer.application");

  ie.visible =false;

  ie.navigate ("http://www.yahoo.com/);

  while ( ie.readystate != 4 ){

      WScript.sleep (10);

  }

--------

Got undterminated string constant char 38

<script LANGUAGE="JScript">

var ie = new ActiveXObject("internetexplorer.application");

ie.visible =false;

ie.navigate ("http://www.yahoo.com/);

while ( ie.readystate != 4 ){

WScript.sleep (10);

}

</script>

The line would be useless unless you wanted the whole script

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...