in reply to [Win32::IE::Mechanize] Page content

Usually in such situations you provide code which demonstrates the problem :) but filling out a form and saving the page doesn't usually save the stuff you typed, not unless the DOM was modified (the page was modified).
  • Comment on Re: [Win32::IE::Mechanize] Page content

Replies are listed 'Best First'.
Re^2: [Win32::IE::Mechanize] Page content
by Gangabass (Vicar) on Jan 14, 2010 at 08:27 UTC

    OK but the code is really simple:

    use strict; use warnings; use Win32::IE::Mechanize; my $ie = Win32::IE::Mechanize->new( visible => 1 ); $ie->get("http://www.valuationpartners.com/vendors"); $ie->form_name("ctl00"); $ie->set_fields( txtUserID => 'user_id', txtPassword => 'password', ); my $btn_name = "btnLogin"; $ie->click( $btn_name ); my $html = $ie->content; save_html($html); sub save_html { my ($html) = @_; open my $out_fh, ">", "Order.htm" or die $!; binmode $out_fh, ":utf8"; print $out_fh $html; close $out_fh; }
      You're not error checking. Probably click never succeeds, so you're still on the login page.

        Did you read my first message? I said "i see data i need in running Internet Explorer" so the click is succeed.