Created
June 20, 2012 02:12
-
-
Save fornext1119/2957763 to your computer and use it in GitHub Desktop.
Python で Internet Explorer を 制御
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment