[Chicago-talk] WSJ.com signon form has changed as of Sunday. Did anyone else notice this?

Ed Summers ehs at pobox.com
Mon Nov 3 08:59:01 CST 2003

On Sun, Nov 02, 2003 at 07:26:35PM -0800, Richard Solberg wrote:
> my $request = $ua->request( POST
> 'http://online.wsj.com/login?URI=%2Fdocuments%2diaries.htm');
> my $form = HTML::Form->parse( $request->content,
> $request->base());
> print $form->dump;

That error indicates to me that the $form object is not defined. I just 
took a look at the HTML::Form doc [1], and it looks like the call to parse()
will return an empty list when there are no forms found in the content that
is passed in to parse. So it would appear that the result of 
$request->content() does not contain a form, perhaps even no HTML.

Make sure you are getting the HTML content you expect when you call
request()...maybe do a little print $request->content() somewhere :)
It's also worth noting that you are basically doing what WWW::Mechanize [2]
does here, by using LWP::UserAgent with HTML::Form. You might want to 
consider making your life easier by using WWW::Mechanize...but you
are probably already aware of this.

Good luck!


[1] http://search.cpan.org/perldoc?HTML::Form
[2] http://search.cpan.org/perldoc?WWW::Mechanize

More information about the Chicago-talk mailing list