marynella has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A tool that logs and then parses the returned HTML.
by CountZero (Bishop) on Dec 23, 2003 at 11:35 UTC | |
by marynella (Novice) on Dec 23, 2003 at 12:46 UTC | |
by CountZero (Bishop) on Dec 23, 2003 at 19:21 UTC | |
by marynella (Novice) on Dec 30, 2003 at 13:55 UTC | |
|
Re: A tool that logs and then parses the returned HTML.
by Art_XIV (Hermit) on Dec 23, 2003 at 14:40 UTC |