in reply to Re^3: Headers and WWW::Mechanize
in thread Headers and WWW::Mechanize

The other error I get is: No such field '__EVENTTARGET' at test.pl line 17...
use warnings; use strict; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $id = '14632'; my $url = "http://home.myspace.com/index.cfm?". "fuseaction=user.viewfriends&". "friendID=" . $id; $mech->get( $url ); my $form = $mech->form_name('aspnetForm'); $form->value('__EVENTTARGET' => 'ctl00$cpMain$pagerTop'); $form->value('__EVENTARGUMENT' => 2); $mech->submit(); print $mech->content;

Replies are listed 'Best First'.
Re^5: Headers and WWW::Mechanize
by Corion (Patriarch) on Jan 31, 2007 at 07:53 UTC

    This error comes because WWW::Mechanize does not find a field by that name in the current form. Maybe such a field does not exist.

    Inspect your current HTML and your current form and look if they are what you think they are. Convenient methods for inspecting are:

    print $mech->content; $mech->save_content('progress.html');
    .

    Also, the documentation recommends the mech-dump utility for inspecting a page and its forms and fields.

    Have you looked at WWW::Myspace ?