Jump to content

Recommended Posts

Posted

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

Posted

INetGet("http://testsite.com/myfile.xx", "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
happy.png

Posted

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.

Posted

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

Do

sleep(500)

Until WinExists("Downloads")

...but with the correct title.

Posted

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

Posted

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>

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
×
×
  • Create New...