Jump to content

downloading via forms


Jury
 Share

Recommended Posts

I've been going around and around trying to make this work - I'm trying to get this <form> to automatically download the retrieved pdf file. I can't see what I'd use to get the value="View as PDF" to fire off - and then the next problem, which I haven't even worked on yet, is how to nominate a directory for it to be saved in. I seem so close but wonder if this all is even possible.

Thanks for any hints / help / laughs

jury

#include <IE.au3>

$file = FileOpen(@MyDocumentsDir & '/vform.html', 2)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, '<html><head><title></title><BASE href="**** a url ****"></head><body><form action="/drs/search-disputes.html" method="get" ><input type="hidden" name="decisionDocumentId" value="6516" /><input type="submit" value="View as PDF" title="Download full decision document" name="action.viewDecisionDocument" class="buttonhover viewAsPDFButton controlButton" /></form></body></html>')

FileClose($file)

$oIE = _IECreate(@MyDocumentsDir & '/vform.html')
$oForm = _IEFormGetCollection($oIE, 0)
$oQuery = _IEFormElementGetCollection($oForm, 1)
_IEFormElementSetValue($oQuery, "ibm")
_IEFormSubmit($oForm)
Sleep(1000)
_IELinkClickByIndex($oIE, 1)
Edited by Jury
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...