I need a perl script that logs on my site, gets the html code and then parse the code to find something I need.
I write a script that works just for some site (e.g. it can log on www.mail.yahoo.com) but when I use it to log on my site the submit doesn't works.

My code is:

#d:\Perl\bin\perl.exe use Win32::GUI; use Win32::OLE; use Win32::GUI::AxWindow; $Window = new Win32::GUI::Window ( -title => "Win32::GUI::AxWindow and Win32::OLE", -pos => [100, 100], -size => [900, 500], -name => "Window", ) or die "new Window"; $Button1 = new Win32::GUI::Button ( -parent => $Window, -name => "Button1", -pos => [0, 25], -size => [200, 50], -text => "Login", ); # more buttons here .. $Control = new Win32::GUI::AxWindow ( -parent => $Window, -name => "Control", -pos => [0, 100], -size => [700, 450], -control => "Shell.Explorer.2", ) or die "new Control"; $OLEControl = $Control->GetOLE(); Win32::OLE->WithEvents($OLEControl,\&Event,"DWebBrowserEvents2"); $url = "http://mysite.com"; $OLEControl->Navigate2($url); Win32::OLE->MessageLoop; $Window->Show(); Win32::GUI::Dialog(); our $doc; # Button Event sub Button1_Click { $OLEControl->{Document}->{login}->{cont}->{value}= "cont"; $OLEControl->{Document}->{login}->{parola}->{value} = "*****"; $OLEControl->{Document}->{login}->{submit}; Win32::OLE->MessageLoop; $doc = $OLEControl->{Document}->{body}->{innerHTML}; }

Could someone help me?


In reply to A tool that logs and then parses the returned HTML. by marynella

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.