回复 3# 奇然无双
下面代码是大概的思路,更具体的自己实现。
注意,要想多标签打开网站,要把IE8设置为3楼的图那样- Dim objIE,username,password
- Set objIE = CreateObject("InternetExplorer.Application")
- objIE.Visible = True
- objIE.Navigate "https://passport.baidu.com/?login"
- While objIE.Busy Or objIE.ReadyState <> 4
- WScript.Sleep 300
- Wend
- username = "Username"
- password = "Password"
- objIE.Document.getElementById("username").value = username
- objIE.Document.getElementById("normModPsp").value = password
- objIE.Document.getElementById("normalF").submit
- WScript.Sleep 300
- While objIE.Busy Or objIE.ReadyState <> 4
- WScript.Sleep 300
- Wend
- If objIE.LocationURL = "http://passport.baidu.com/center" Then
- MsgBox "登录成功!"
- End If
- objIE.Navigate "http://www.sina.com.cn/",,"_blank"
- Set objIE = Nothing
复制代码 |