Sign in to follow this  
Followers 0

Downloading File

6 posts in this topic


I am trying automating download a file from I can easily bowse through the website and reach to the download link. But I am not able to initiate the download process. my code uptill now is

#include <IE.au3>
$oIE = _IECreate("")
_IELinkClickByText($oIE,"GDP & Personal Income",1)
_IELinkClickByText($oIE,"Begin Using the Data...")
_IELinkClickByText($oIE, "Personal income (SQ1)")
$oForm = _IEFormGetObjByName($oIE, "myform7")
$oSelect = _IEFormElementGetObjByName($oForm, "7026")
_IEFormElementOptionSelect($oSelect, "Iowa", 1, "byText")
$oSelect2 = _IEFormElementGetObjByName($oForm, "7027")
_IEFormElementOptionSelect($oSelect2, "All Years", 1, "byText")
_IEFormElementOptionSelect($oSelect2, "2011", 0, "byText")
$oSelect3 = _IEFormElementGetObjByName($oForm, "7028")
_IEFormElementOptionSelect($oSelect3, "Personal Income", 1, "byText")
$AccountButton = _IEGetObjById($oIE,'goto7')
_IEAction($AccountButton, "click")
_IELinkClickByText($oIE, "Download")
_IELinkClickByText($oIE, "Download XLS File")

I may be running into the problem cause after I press Download button the screen freezez and a new pop up come asking me what kind of file i want to download.

Any help in this problem will be appreciated.


Share this post

Link to post
Share on other sites

INetGet("", "c:usersuserdesktop", 1,1)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better

Share this post

Link to post
Share on other sites

I dont think that INetGet will be any helpfl cause the website produces a different link everytime I broiwse through as the content in the excel file is updated. I need a way to either get the link from the pop up button or hit that button to initiate the download process.

Share this post

Link to post
Share on other sites

After you click the download button, you want to put either a _IELoadWait or maybe something like:



Until WinExists("Downloads")

...but with the correct title.

Share this post

Link to post
Share on other sites

It stiull doesnt work as soon as i click download XLS file a new window pop ups for a sec and vanishes and thye autoit script keeps running!!

Share this post

Link to post
Share on other sites

the HTML component of the download button is

<a href="download.cfm?ext=xls&amp;fid=85CD5C5FD05DB9069819359089BB749068B1F7A69874E07C4C125F47FDEFAE13CC926FC9BE251D557ED3F5A8E8FE8D05F0E448B9ABAE4708056611E496046D81" onclick="clearPageLocks()" target="_blank">Download XLS File</a>

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

  • Similar Content

    • drorshem
      By drorshem
      I'm looking to create a script which will download all *.txt files from a remote FTP server.
      Once downloaded, delete all *.txt files.
      Can this be achieved using AutoIt ?
    • harvester2001
      By harvester2001
      Hi I need your help
      I need download backup from 200 remote pc. I calculate that I can download 20 backups in one time. I need to create loop, take localizations from txt file and start 20 downloads in one time (i want use ShellExecute and robocopy), after finish one from running 20 take another localizations from txt file until localizations finish. And I need trigger if is 7:00 pause script. I hope you know what I mean
      Many thanks for help, sorry for my english.
      This is what I got:
      #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <Array.au3> #include <Date.au3> Local $targets = @ScriptDir& "\targets.txt" Local $log_name = "\autoit.log" MsgBox($MB_SYSTEMMODAL, "", "start copy", 1) Example() Func Example() If Not FileExists($targets) Then MsgBox($MB_SYSTEMMODAL, "", "The file targets.txt - doesn't exist!") Exit EndIf FileOpen($targets, 0) Global $arr[1000] ReDim $arr[_FileCountLines($targets)+1] For $i = 1 to _FileCountLines($targets) $line = FileReadLine($targets, $i) $arr[$i] = $line ; Check if is online Local $iPing = Ping($arr[$i], 250) If $iPing Then ; ONLINE $rc = FileCopy("\\"&$arr[$i]&"\e$\backup\", @ScriptDir&"\downloads\"&$arr[$i]&"\", $FC_CREATEPATH) If $rc = 0 Then _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" ONLINE error") Else _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" ONLINE done") EndIf Else ;OFFLINE _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" OFFLINE") EndIf Next EndFunc ;==>Example MsgBox($MB_SYSTEMMODAL, "", "Finish downloads backups") Exit  
    • 31290
      By 31290
      Hi everyone, 
      Following this page:
      I have to download the BIOS for the E5440 model. As I don't know in which order Dell will place the description and the link to download the file (also because the 5440 can be put in first) I'd like to make  the following piece of code to search only first the link that deals with the E5440:
      (The only thing I'm sure is that the string E5440 will be either in the first or the second position and I need to download the corresponding link)
      Local $sRead = InetRead('', 1) ConsoleWrite(BinaryToString($sRead) & @CRLF) Local $aData = _StringBetween(BinaryToString($sRead), 'Type: BIOS', 'Category:') TrayTip("", "Downloading latest BIOS Version, please wait...", 10, 3) Local $aLinks = _StringBetween($aData[0], '<A HREF="/', '"><IMG') For $i = 0 To UBound($aLinks) - 1 $aLinks[$i] = '' & $aLinks[$i] Next Local $hDownload = InetGet($aLinks[0], @DesktopDir & "\BIOSE5450.exe", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Do Sleep(250) Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD) Local $iFileSize = Round(FileGetSize(@DesktopDir & "\BIOSE5450.exe") / 1048576) InetClose($hDownload) MsgBox(0, "", "The latest E5450 BIOS (" & $iFileSize & " MB) have been downloaded")
      I was thinking of an string search in the array but all my attempts failed for now.
      Can someone could give me a hand over here.
    • 31290
      By 31290
      Hi Guys, 
      Hope you're doing fine today.
      Well, I'm trying to achieve something I want to integrate to a tool I already created.
      At work, we deploy computers massively and we use the tool to perform automatic operations. Then, we have to update the BIOS to the latest version. To avoid a heavy tool, I'd like to automatically download the latest BIOS on the Dell Website but the thing is that the name of the fail change when a new version is published. Of course, I cannot know what version will be deployed by Dell but I have this when connecting to the website:

      Thus, I don't know if the FOLDERXXXXX of the download URL will change if a new version ins deployed. 

      Here's one of the pages of a model we also use:
      Well, i'm kind of stuck here and maybe someone could point something out
      Thanks in advance
    • Wicked_Caty
      By Wicked_Caty
      I've written a bot that is loading down  pictures from a website. Basically, it opens the website, saves the picture via context menu, and hits a button for loading the next pic. Unfortunately, the pics and my internet connection aren't always the same and it takes longer to load at times. Right now I've got a sleep(3000) in my code, but it isn't very efficient. I waste time if it loads faster than 3000ms, and the program fails if it takes more than 3000ms. So I wanted to make a function that waits until the picture has loaded, and then saves it. 
      I don't know if that causes any problems with possible functions, but it isn't the tab that's loading. The loading circle doesn't appear. It's something on the website.
      I've adapted to program to chrome, so I'd have to rewrite it partially for the IE functions, so it'd be nice if there was a solution for chrome. --- Thanks!