用WebBrowser1登录QQ的问题
Private Sub Command1_Click()WebBrowser1.Navigate2 "http://ui.ptlogin2.
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, Url As Variant)
'On Error Resume Next
If InStr(Url, "ui.ptlogin2.) <> 0 Then '登录页面
pDisp.Document.getElementById("u").Value = "392354601" '账号
pDisp.Document.getElementById("p").Value = "a123456" '密码
pDisp.Document.getElementById("p").onchange
pDisp.Document.getElementById("p").Click
'pDisp.Document.getElementById("verifycode").Value = "xmsz" '验证码
'pDisp.Document.getElementById("login_button").Click '登录
End If
End Sub
'源码如下
Private Sub Command1_Click()
WebBrowser1.Navigate2 "http://ui.ptlogin2.
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, Url As Variant)
On Error Resume Next
If InStr(Url, "ui.ptlogin2.) <> 0 Then '登录页面
pDisp.Document.getElementById("u").Value = "392354601" '账号
pDisp.Document.getElementById("p").Value = "a123456" '密码
pDisp.Document.getElementById("p").Click '密码框需要手动点击一下,这句没有效果?
'pDisp.Document.getElementById("verifycode").Value = "xmsz" '验证码
'pDisp.Document.getElementById("login_button").Click '登录
End If
End Sub
直接按登录键不能正确登录 , 会出现验证码的提示框
如果手动点击密码框一下 , 再按登录键则可正常登录
求高手指点