ptryon Posted July 23, 2012 Share Posted July 23, 2012 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"> </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 updated2012-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"> </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> Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 23, 2012 Moderators Share Posted July 23, 2012 (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 July 23, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ptryon Posted July 23, 2012 Author Share Posted July 23, 2012 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. Link to comment Share on other sites More sharing options...
ptryon Posted July 27, 2012 Author Share Posted July 27, 2012 Hey out there. Any other thoughts on this? Link to comment Share on other sites More sharing options...
MrMitchell Posted July 27, 2012 Share Posted July 27, 2012 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? Link to comment Share on other sites More sharing options...
ptryon Posted July 31, 2012 Author Share Posted July 31, 2012 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. Link to comment Share on other sites More sharing options...
MrMitchell Posted August 2, 2012 Share Posted August 2, 2012 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... Link to comment Share on other sites More sharing options...
ptryon Posted August 2, 2012 Author Share Posted August 2, 2012 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. Link to comment Share on other sites More sharing options...
MrMitchell Posted August 2, 2012 Share Posted August 2, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now