ForNext
Only Do What Only You Can Do
Internet Explorer を 起動する
VBScript
更新日 : 2012.06.20
Option Explicit Dim ie: Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ie.Toolbar = True ie.MenuBar = True ie.AddressBar = True ie.StatusBar = True 'ログオン画面 ie.Navigate "http://192.168.1.1/zzzz.asp" Do While ie.Busy Or ie.readystate <> 4 WScript.Sleep 1000 Loop 'ユーザID ie.Document.getElementById("txtUserID").Value = "xxxxx" 'パスワード ie.Document.getElementById("txtPassWD").Value = "yyyyy" 'ログオン ie.Document.forms(0).submit()
JScript
更新日 : 2012.06.20
var ie = WScript.CreateObject("InternetExplorer.Application"); ie.Visible = true; ie.Toolbar = true; ie.MenuBar = true; ie.AddressBar = true; ie.StatusBar = true; //ログオン画面 ie.Navigate("http://192.168.1.1/zzzz.asp"); while (ie.Busy || ie.readystate != 4) WScript.Sleep(1000); //ユーザID ie.document.getElementById("txtUserID").value = "xxxxx"; //パスワード ie.document.getElementById("txtPassWD").value = "yyyyy"; //ログオン ie.document.forms(0).submit();
Perl
更新日 : 2012.06.20
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();
PHP
更新日 : 2012.06.20
<?php $ie = new COM('InternetExplorer.Application'); $ie->Visible = true; $ie->ToolBar = true; $ie->MenuBar = true; $ie->AddressBar = true; $ie->StatusBar = true; #ログオン画面 $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(); ?>
Python
更新日 : 2012.06.20
# coding: Shift_JIS import win32api, win32con, win32com, win32com.client, os, time, sys ie = win32com.client.Dispatch("InternetExplorer.Application") ie.Visible = True ie.ToolBar = True ie.MenuBar = True ie.AddressBar = True ie.StatusBar = True #ログオン画面 ie.Navigate('http://192.168.1.1/zzzz.asp') while (ie.Busy and ie.ReadyState != 4): time.sleep(1) #ユーザID ie.Document.getElementById("txtUserID").Value = "xxxxx" #パスワード ie.Document.getElementById("txtPassWD").Value = "yyyyy" #ログオン ie.Document.forms(0).submit()
Ruby
更新日 : 2012.06.20
require 'win32ole' ie = WIN32OLE.new('InternetExplorer.Application') ie.Visible = true ie.Toolbar = true ie.MenuBar = true ie.AddressBar = true ie.StatusBar = true #ログオン画面 ie.Navigate 'http://192.168.1.1/zzzz.asp' while (ie.Busy || ie.readystate != 4) sleep 1 end #ユーザID ie.Document.getElementById("txtUserID").Value = "xxxxx" #パスワード ie.Document.getElementById("txtPassWD").Value = "yyyyy" #ログオン ie.Document.forms(0).submit()
PowerShell
更新日 : 2012.06.20
$ie = New-Object -ComObject internetexplorer.application $ie.Visible = $true $ie.Toolbar = $true $ie.MenuBar = $true $ie.AddressBar = $true $ie.StatusBar = $true #ログオン画面 $ie.Navigate('http://192.168.1.1/zzzz.asp') while($ie.busy -or $ie.readystate -ne 4) { Start-Sleep 1 } #ユーザID $ie.document.getElementById("txtUserID").Value = "xxxxx" #パスワード $ie.document.getElementById("txtPassWD").Value = "yyyyy" #ログオン @($ie.Document.forms)[0].submit()