Gangabass has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks

It's very strange but i can't get page HTML with Win32::IE::Mechanize ($ie->content).

I'm filling login form and see data i need in IE but after saving $ie->content to the file i see only login form again.

Can you show me some directions to fix this strange situation?

P. S. Trying Win32::IEAutomation now...

Update: It works for Win32::IEAutomation...

Replies are listed 'Best First'.
Re: [Win32::IE::Mechanize] Page content
by Anonymous Monk on Jan 14, 2010 at 08:13 UTC
    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).

      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.