Jump to content

How to download file using AutoIT?


Recommended Posts

Referring to following coding and image, I would like to know on how to handle click button and save file into specific folder using AutoIT.

Saving Path : C:\download\

Does anyone have any suggestions?
Thanks in advance for any suggestions

 

#include <IE.au3>
#include <array.au3>
#include <File.au3>
#include <MsgBoxConstants.au3>

   $oIE = _IECreate("https://fred.stlouisfed.org/series/WALCL")

   $oTag = _IEGetObjById ($oIE, "download-button-container")

   If Not IsObj($oTag) Then

   Else

      _IEAction ($oTag, "click")
      _IELoadWait ($oIE, 5000)

   EndIf

 

Download.png

Link to comment
Share on other sites

@oemript  I made it working to download the csv file.  Look for InetGet () to actually get the file.  You will need to use .href of the object to obtain the csv file.  And my last hint, your $oTag doesn't use the right id, take a careful look at the DOM.

Happy scripting !

 

Edited by Nine
Link to comment
Share on other sites

Referring to following coding, I would like to know on how to change save path into C:\temp folder

Local $sFilePath = _WinAPI_GetTempFileName(@TempDir)

Do you have any suggestions?

Thanks, to everyone very much for any suggestions (^v^)

 

Edited by oemript
Link to comment
Share on other sites

Referring to following image, I would like to know on what function should be used to retrieve href : URL based on given id="download-data"

Do you have any suggestions?
Thanks, to everyone very much for any suggestions (^v^)

 

ID.png

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...