Skip to content

Instantly share code, notes, and snippets.

@fornext1119
Created June 20, 2012 02:04
Show Gist options
  • Save fornext1119/2957723 to your computer and use it in GitHub Desktop.
Save fornext1119/2957723 to your computer and use it in GitHub Desktop.
Perl で Internet Explorer を 制御
use strict;
use warnings;
use Win32::OLE;
my $ie = Win32::OLE->new('InternetExplorer.Application');
$ie->{Visible} = 1;
$ie->{ToolBar} = 1;
$ie->{MenuBar} = 1;
$ie->{AddressBar} = 1;
$ie->{StatusBar} = 1;
#ログオン画面
$ie->Navigate('http://192.168.1.1/zzzz.asp');
while($ie->Busy() || $ie->ReadyState() != 4)
{
sleep(1);
}
#ユーザID
$ie->Document->getElementById("txtUserID")->{Value} = "xxxxx";
#パスワード
$ie->Document->getElementById("txtPassWD")->{Value} = "yyyyy";
#ログオン
$ie->Document->forms(0)->submit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment