Hey everyone, I just recently started working on a project to automate some online web forms for my co-workers here - trying to eliminate entering the same info multiple times at different places. I put together a small script using WWW::Mechanize to take care of this, and it works like a charm up until the very end where things just up and die. I can get past the login, pull up the form, fill in the details, click the submit button, view the confirmation page showing my previously entered data, and click "Add Listing" - which is the final step, and where things hiccup.
[EMAIL PROTECTED] bin]$ ./mlocator.pl Can't call method "header" on an undefined value at /usr/lib/perl5/site_perl/5.8.5/WWW/Mechanize.pm line 2003. # Looks like your test died before it could output anything. [EMAIL PROTECTED] bin]$ I am grabbing the newlisting.asp page on its own instead of in it's frame, and the confirm page is also then not in its own page, but I don't know that doing so would kill things. I have autocheck => 1 in my constructor, and if I add "die unless ($mech->success);" after each use of $mech's functions, things run all the way to the end without indication of previous errors. Below I have my output listing after adding use LWP::Debug qw(+); Right before the end there is an extract_cookies message, maybe that has something to do with it? I have $mech->cookie_jar(HTTP::Cookies->new); once in my script, right after initializing $mech. So... any ideas or input you folks might have would be very much appreciated. If you want to see the script, or want to see some different type of debug output, let me know and I'll get things posted. Thanks, Mark LWP::UserAgent::new: () LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: GET http://www.machinelocator.com/ws/update/ LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 450 bytes LWP::UserAgent::request: Simple response: Unauthorized LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: GET http://www.machinelocator.com/ws/update/ LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 874 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 218 bytes HTTP::Cookies::extract_cookies: Set cookie Multistore => HTTP::Cookies::extract_cookies: Set cookie LineColor => FA570F HTTP::Cookies::extract_cookies: Set cookie CurrencyPref => USD HTTP::Cookies::extract_cookies: Set cookie DealerNo => 638180 HTTP::Cookies::extract_cookies: Set cookie Username => vani1 HTTP::Cookies::extract_cookies: Set cookie ASPSESSIONIDSQASARQA => ADGGAHKDLAFNBMKIGJDJNKFE LWP::UserAgent::request: Simple response: OK LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: - checking cookie path=/ws/update/ HTTP::Cookies::add_cookie_header: - checking cookie CurrencyPref=USD HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Username=vani1 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Multistore= HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie LineColor=FA570F HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie DealerNo=638180 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie path=/ HTTP::Cookies::add_cookie_header: - checking cookie ASPSESSIONIDSQASARQA=ADGGAHKDLAFNBMKIGJDJNKFE HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: GET http://www.machinelocator.com/ws/update/newlisting.asp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 450 bytes LWP::UserAgent::request: Simple response: Unauthorized LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: - checking cookie path=/ws/update/ HTTP::Cookies::add_cookie_header: - checking cookie CurrencyPref=USD HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Username=vani1 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Multistore= HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie LineColor=FA570F HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie DealerNo=638180 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie path=/ HTTP::Cookies::add_cookie_header: - checking cookie ASPSESSIONIDSQASARQA=ADGGAHKDLAFNBMKIGJDJNKFE HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: GET http://www.machinelocator.com/ws/update/newlisting.asp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 264 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1380 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1380 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1152 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 185 bytes LWP::UserAgent::request: Simple response: OK LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: - checking cookie path=/ws/update/ HTTP::Cookies::add_cookie_header: - checking cookie CurrencyPref=USD HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Username=vani1 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Multistore= HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie LineColor=FA570F HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie DealerNo=638180 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie path=/ HTTP::Cookies::add_cookie_header: - checking cookie ASPSESSIONIDSQASARQA=ADGGAHKDLAFNBMKIGJDJNKFE HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: POST http://www.machinelocator.com/ws/update/confirm.asp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 450 bytes LWP::UserAgent::request: Simple response: Unauthorized LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.machinelocator.com for cookies HTTP::Cookies::add_cookie_header: - checking cookie path=/ws/update/ HTTP::Cookies::add_cookie_header: - checking cookie CurrencyPref=USD HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Username=vani1 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie Multistore= HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie LineColor=FA570F HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie DealerNo=638180 HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: - checking cookie path=/ HTTP::Cookies::add_cookie_header: - checking cookie ASPSESSIONIDSQASARQA=ADGGAHKDLAFNBMKIGJDJNKFE HTTP::Cookies::add_cookie_header: it's a match HTTP::Cookies::add_cookie_header: Checking .machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking machinelocator.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: POST http://www.machinelocator.com/ws/update/confirm.asp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 1109 bytes LWP::Protocol::collect: read 1368 bytes LWP::Protocol::collect: read 574 bytes HTTP::Cookies::extract_cookies: Set cookie requestStatus => Action+cancelled%3A+Add+Listing LWP::UserAgent::request: Simple response: OK Can't call method "header" on an undefined value at /usr/lib/perl5/site_perl/5.8.5/WWW/Mechanize.pm line 2003. # Looks like your test died before it could output anything.