Mark,

Looking at the docs, I couldn't see a way either. :/

So, I whipped up a quick example with HTML::TokeParser::Simple. It's
searching for "size" rather than "maxlength", but you get the idea.

use WWW::Mechanize;
use HTML::TokeParser::Simple;

my $www = WWW::Mechanize->new;
$www->get( 'http://search.cpan.org/' );

my $content = $www->content;

my $p = HTML::TokeParser::Simple->new( \$content );

while ( my $token = $p->get_token ) {
        next unless $token->is_tag( 'input' );
        my $attr = $token->return_attr;
        print 'size = ' . $attr->{ size } if $attr->{ size };
}

-Brian

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Mark Stosberg
> Sent: Monday, December 08, 2003 12:08 PM
> To: [EMAIL PROTECTED]
> Subject: a way to get at form tag attributes?
> 
> Hello,
> 
> I'm interested in getting at the "maxlength" attribute value of an input
> tag. I looked at the HTML::Form docs and didn't see how to use it for
> that. Is it possible way with HTML::Form? If not, is there is another
> easy way to get at this when using WWW::Mechanize?
> 
> Thanks!
> 
>       Mark
> 
> --
>  . . . . . . . . . . . . . . . . . . . . . . . . . . .
>    Mark Stosberg            Principal Developer
>    [EMAIL PROTECTED]     Summersault, LLC
>    765-939-9301 ext 202     database driven websites
>  . . . . . http://www.summersault.com/ . . . . . . . .


http://www.gordano.com - Messaging for educators.

Reply via email to