|
Re: Help, Please: Can't Get a Hold of <input type=button ...>: msg#00026lang.perl.modules.lwp
On Sun, 2004-09-12 at 07:32, John J Lee wrote: > On Wed, 8 Sep 2004, Daniel E. Doherty wrote: > > > I hit a page on the FDIC website that allows me to download Bank > > Performance Reports, so-called "Call Reports." I can fill in the fields > > on the page, but the button that kicks off the file transfer is > > generated by an HTML tag like this: > > > > <input type="button" value="Export" onclick="FormSubmit(this.form);"> > [...] > > Is this right? I'm no HTML expert, but my 1998 O'Reilly book on HTML, > > covering HTML 4.0 states that <input type="button" ...> is a synonym for > > <button ...>. > > No, they're not synonymous. Quoting from my FAQ on my Python module based > on HTML::Forms (see second bullet point -- your callback JavaScript > function is FormSubmit()): > > http://wwwsearch.sourceforge.net/ClientForm/#faq > > Why does .click()ing on a button not work for me? > > - Clicking on a RESET button doesn't do anything, by design - this is a > library for web automation, not an interactive browser. Even in an > interactive browser, clicking on RESET sends nothing to the server, so > there is little point in having .click() do anything special here. > > - Clicking on a BUTTON TYPE=BUTTON doesn't do anything either, also by > design. This time, the reason is that that BUTTON is only in the HTML > standard so that one can attach callbacks to its events. The callbacks are > functions in SCRIPT elements (such as Javascript) embedded in the HTML, > and their execution may result in information getting sent back to the > server. ClientForm, however, knows nothing about these callbacks, so it > can't do anything useful with a click on a BUTTON whose type is BUTTON. > > - Generally, embedded script may be messing things up in all kinds of ways. > See the answer to the next question. > Thanks. Here is the javascript function that gets invoked: function FormSubmit(objForm) { var strVersion = new String(navigator.appVersion); var arrVersion = strVersion.split(" "); var intVersion = new Number(arrVersion[0]); objForm.BrowserName.value = navigator.appName; if (navigator.appName == "Netscape") { //alert("here"); objForm.action = "NSPrint.asp"; } objForm.submit(); } One of the solutions you recommend is to do in python what the script does. It looks to me like this script just submits the form or prints for Navigator (though I don't know much about javascript). It would seem, then, that I ought to be able to do $mech->submit(). But when I do that, I get empty content in the response, though response is OK and the content-type is "application/textfile" and the content-disposition is "inline; filename=Cert4619_P". I am expecting a tab-delimited file. I just can't get it to move the file. Any thoughts? > > John -- Dan Doherty ded-law@xxxxxxxxxxxx 913.402.7336 (Voice) 913.402.7336 (Fax) 913.488.3342 (Mobile) |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: HTML::Parser modifies unicode characters: 00026, Moshe Kaminsky |
|---|---|
| Next by Date: | Re: Help, Please: Can't Get a Hold of <input type=button ...>: 00026, John J Lee |
| Previous by Thread: | Re: Help, Please: Can't Get a Hold of <input type=button ...>i: 00026, John J Lee |
| Next by Thread: | Re: Help, Please: Can't Get a Hold of <input type=button ...>: 00026, John J Lee |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |