Jump to content

Downloading File


aggarwal
 Share

Recommended Posts

Hello

I am trying automating download a file from www.bea.gov 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("http://www.bea.gov/itable/")
_IELinkClickByText($oIE,"GDP & Personal Income",1)
_IELinkClickByText($oIE,"Begin Using the Data...")
Sleep(1000)
_IELinkClickByText($oIE, "Personal income (SQ1)")
Sleep(2000)
$oForm = _IEFormGetObjByName($oIE, "myform7")
$oSelect = _IEFormElementGetObjByName($oForm, "7026")
_IEFormElementOptionSelect($oSelect, "Iowa", 1, "byText")
$oSelect2 = _IEFormElementGetObjByName($oForm, "7027")
_IEFormElementOptionSelect($oSelect2, "All Years", 1, "byText")
Sleep(1000)
_IEFormElementOptionSelect($oSelect2, "2011", 0, "byText")
$oSelect3 = _IEFormElementGetObjByName($oForm, "7028")
_IEFormElementOptionSelect($oSelect3, "Personal Income", 1, "byText")
$AccountButton = _IEGetObjById($oIE,'goto7')
_IEAction($AccountButton, "click")
Sleep(2000)
_IELinkClickByText($oIE, "Download")
Sleep(1000)
_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.

Thanks

Link to comment
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.

Link to comment
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>

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

×
×
  • Create New...