Help, Please: Can"t Get a Hold of <input type=button ...>

Help, Please: Can"t Get a Hold of <input type=button ...>

am 09.09.2004 03:54:01 von ded

Listers,

I am new to WWW::Mechanize, and have gotten it to mechanize alot of
point and click stuff, so it's really great. But I cam across a page
that refuses to yeild. I hope someone can help.

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:



I have tried to click it three ways, by specifying the value, the
number, and by just invoking $mech->submit() after selecting into the
form. None of these worked:

1. $mech->click_button(value => 'Export') yeilds "Can't call method
'header' on undefined value." error.

2. $mech->click_button(number => 1) yeilds "Can't call method 'click' on
undefined value." error.

3. $mech->submit() yeilds no error, but no content either.

I poked around in the code, and it looks like HTML::Form is parsing the
tag as a type HTML::Form::IgnoreInput, which
it does very effectively. Apparently, it only counts a type="submit" ...> tag as a button.

Is this right? I'm no HTML expert, but my 1998 O'Reilly book on HTML,
covering HTML 4.0 states that is a synonym for

Re: Help, Please: Can"t Get a Hold of <input type=button ...>

am 12.09.2004 14:32:44 von jjl

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:
>
>
[...]
> Is this right? I'm no HTML expert, but my 1998 O'Reilly book on HTML,
> covering HTML 4.0 states that is a synonym for
>

Re: Help, Please: Can"t Get a Hold of <input type=button ...>

am 13.09.2004 14:46:14 von ded-law

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:
> >
> >
> [...]
> > Is this right? I'm no HTML expert, but my 1998 O'Reilly book on HTML,
> > covering HTML 4.0 states that is a synonym for
> >

Re: Help, Please: Can"t Get a Hold of <input type=button ...>

am 14.09.2004 00:42:56 von jjl

On Mon, 13 Sep 2004, Daniel E. Doherty wrote:
[...]
> 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
[...]

The last line submits the form. The rest of it doesn't .

For example, objForm.action = "blah" sets the form element's action
attribute to "blah", thus causing objForm.submit() to submit to a
different URL. Google for "HTML 4.01 spec", and read the documentation
for the Form element's action attribute. Then try looking at the HTML
that contains the JavaScript function above, and figure out what
objForm.BrowserName.value = "whatever" does (search for "BrowserName" in
the HTML).


John