Sign in to follow this  
Followers 0
dwaynek

how do i check firefox has completed downloading a page?

10 posts in this topic

I'm writing a script to launch firefox and load a website but instead of putting in a time delay (because this can vary depending on the response from the website, the speed of the computer, what other tasks is being done etc), how do i check firefox that it has completed downloading a page before continuing the script?

Share this post


Link to post
Share on other sites



Does FF pop up a window while it's downloading?


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Does FF pop up a window while it's downloading?

yes, but that window contains a list of many other downloads too.

*looks at it with autoit window info*

ok well you won't get any info from the controls, but I would look for this:

When the title of the window changes from

*% of * file

to

Downloads

that will mean that the download is complete.

one sec, i'll put together some code for you.

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

yes, but that window contains a list of many other downloads too.

*looks at it with autoit window info*

ok well you won't get any info from the controls, but I would look for this:

When the title of the window changes from

*% of * file

to

Downloads

that will mean that the download is complete.

This all assumes no other download extensions have been installed


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This all assumes no other download extensions have been installed

that's true...I don't think theres any sure-fire way, since you never know what extensions the user might have.

but i can still write up some code for the regular downloader

I don't think I've ever used regular expressions, but would this be correct?

(?i)[:digit:]*% of [:digit:]* file

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

yep, it worked, here ya go

Opt ("WinTitleMatchMode", 4)

While Not WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?")
    Sleep (100)
WEnd

While WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?")
    TrayTip ("", "downloading...", 10)
    Sleep (500)
WEnd
TrayTip ("", "", 0)
Sleep (1000)
If WinExists ("Downloads") Then
    MsgBox (0, "info", "download complete")
Else
    MsgBox (0, "", "you can't close the window or you'll mess it up...")
EndIf

thats actually pretty cool :whistle:


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Is the OP asking about downloading a file or loading the page ?

If loading a page is what is being done then something like a PixelCheckSum of the animated graphic in the top right might do.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

yep, it worked, here ya go

Opt ("WinTitleMatchMode", 4)

While Not WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?")
    Sleep (100)
WEnd

While WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?")
    TrayTip ("", "downloading...", 10)
    Sleep (500)
WEnd
TrayTip ("", "", 0)
Sleep (1000)
If WinExists ("Downloads") Then
    MsgBox (0, "info", "download complete")
Else
    MsgBox (0, "", "you can't close the window or you'll mess it up...")
EndIf

thats actually pretty cool ;)

I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option :whistle: ?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option :whistle: ?

3.2.1.7


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option :whistle: ?

lol, I just saw a post by valik on it yesterday, I never knew that either ;)

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
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
Sign in to follow this  
Followers 0