Click to See Complete Forum and Search --> : mech errors with - "There is no form named" - when it exists


crmpicco
04-13-2007, 11:31 AM
use WWW::Mechanize;
$mech = WWW::Mechanize->new(cookie_jar => undef,stack_depth => 0);
....code....
$mech->form_name("myForm");

When i use the code above to screen scrape a webpage using Mech, i get this error SOMETIMES, but not always??
i know 'myForm' is there (for sure). is this something to do with server load?
There is no form named "myForm" at /usr/lib/perl5/Picco/mod/Test.pm line 420

phwaap
04-15-2007, 12:27 PM
Have you dumped the page every time it says the form isn't there? It's not uncommon to remove a form from a page based on certain criteria, e.g. you've already voted in a poll. Does this happen when you select the form by number as well?