Sign in to follow this  
Followers 0
ptryon

Click download button

9 posts in this topic

I am trying to click the download button in the following html source file. There are two buttons on this page both with the type submit. I tried using the info in the action for this part of the form but it says the file is not available to do a direct download after I have logged in. I basically want to click the download button and then follow the regular ie download dialog boxes to save the file. Any thoughts would be helpful.

<body onload="self.focus()">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td align="center" valign="top"><table width="400" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:1px solid #394B01;">

<tr><td colspan="3" valign="top"><img src="/images/green_ribbon.gif" width="422" height="6"></td></tr>

<!-- Close (Start) -->

<tr>

<td width="12"><img src="/images/trans.gif" width="14" height="5"></td>

<td align="right" valign="top"><button class="bodytext" type="submit" onclick="self.close()">Close</button></td>

<td width="12">&nbsp;</td>

</tr>

<!-- Close (End) -->

<!-- Expired (Start) -->

<!-- Expired (End) -->

<tr>

<td width="12" rowspan="2"><img src="/images/trans.gif" width="14" height="5"></td>

<td>

<table border="0" cellpadding="0" cellspacing="0">

<!-- Title (Start) -->

<tr class="title"><td valign="top"><strong>

Agencylookup15

</strong></td></tr>

<tr><td><img src="/images/trans.gif" width="5" height="5"></td></tr>

<tr><td><img src="/images/greenline.gif" width="400" height="1" border="0" alt=""></td></tr>

<tr><td><img src="/images/trans.gif" width="5" height="5"></td></tr>

<!-- Title (End) -->

<!-- Date (Start) -->

<tr class="downloadtext"><td valign="top">

Last updated

2012-07-23

</td></tr>

<tr><td><img src="/images/trans.gif" width="5" height="5"></td></tr>

<!-- Date (End) -->

<!-- Description (Start) -->

<tr class="bodytext"><td valign="top">

Reference Information for Agency Data Includes: Agency number, name, address, city, postal code (Week 15)

</td></tr>

<tr><td><img src="/images/trans.gif" width="5" height="15"></td></tr>

<!-- Description (End) -->

<!-- Submit (Start) -->

<tr><td><img src="/images/trans.gif" width="5" height="5" ></td></tr>

<tr><td>

<form action="/lcbosod-ear/SODDownload/agencylookup15.zip" method="post" name="download">

<input type="HIDDEN" name="language" value="EN">

<input type="HIDDEN" name="DOCID" value="156628">

<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">

<tr><td align="center" width="50%"><button class="bodytext" type="submit"><strong>Download</strong></button></td></tr>

</table>

</form>

</td></tr>

<!-- Submit (End) -->

</table>

</td>

<td width="12" rowspan="2">&nbsp;</td>

</tr>

<!-- Footer (Start) -->

<tr><td colspan="3"><img src="/images/trans.gif" width="5" height="5" ></td></tr>

<tr><td colspan="3" valign="bottom"><img src="/images/green_ribbon.gif" width="422" height="6"></td></tr>

<!-- Footer (End) -->

</table></td>

</tr>

</table>

</body>

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, ptryon, welcome to the forum. What is the URL you are trying to save the file from? There may be better options to obtain the file you seek, such as INetGet.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks. The page just has a close button and a download button. There is no url provided to just download the file. Once i click on the download button there must be some javascript that is run and then I get the dowload dialog. I looked at Inetget but without a url I am not sure what i can do.

Share this post


Link to post
Share on other sites

Hey out there. Any other thoughts on this?

Share this post


Link to post
Share on other sites

There is no url provided to just download the file.

What happens when you tag /lcbosod-ear/SODDownload/agencylookup15.zip to the end of the URL in address bar?

Once i click on the download button there must be some javascript that is run and then I get the dowload dialog.

When you say must are you saying there is or are you assuming there is some Javascript?

Share this post


Link to post
Share on other sites

At present I am assuming there is some javascript. When I append the tag with .........zip it just comes up with the download page with the two buttons indicating the file cannot be found.

Share this post


Link to post
Share on other sites

At present I am assuming there is some javascript. When I append the tag with .........zip it just comes up with the download page with the two buttons indicating the file cannot be found.

Any chance you can provide the actual web page?

Another quick question, are you logging in to this page manually or are you automating it somehow? It sounds like you need to be logged in to download this file but you haven't mentioned if/how you're logging in so I can't tell if you're familiar with the _IE commands or not...

Share this post


Link to post
Share on other sites

Thanks for the reply. Unfortunately it is a secure site that we log onto to get our sales data. I have automated that process. So my script loads the login form. logs in and navigates all the way to the download page that I provided. The only thing is there is nothing to identify the actual dowload button. I tried using the watch feature to see if it could help me but it just gave the coordinates of the button on the screen. I am using an index for the links. But I don't see that for the button.

Share this post


Link to post
Share on other sites

The button is only 1 inside the form. The form has a name...

Try getting the form with _IEFormGetObjByName()

Then submit the form with _IEFormSubmit()

if the submit doesn't work try getting reference to the button using _IETagNameGetCollection() using your form as the object and "button" as the tag name. The try using _IEAction() to click the button.

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