vb webbrowser 网页登陆 iframe 没有ID 和NAME 如何给里面的文本框赋值呢
'添加部件MicrosoftInternetControls'引用MicrosoftHTMLObjectLibraryPrivateSubCommand1_Click()...
'添加部件Microsoft Internet Controls
'引用Microsoft HTML Object Library
Private Sub Command1_Click()
Dim Doc2 As HTMLDocument
Dim Web2 As WebBrowser_V1
Dim LikeUrl As String
LikeUrl = "<a href="https://mailsso.mxhichina.com/login.htm?app_code=smartmail&device_id=" target="_blank">https://mailsso.mxhichina.com/login.htm?app_code=smartmail&device_id=</a>*"
Set Web2 = GetFrameLikeUrl(Web1.Document, LikeUrl)
If Not Web2 Is Nothing Then
Set Doc2 = Web2.Document
Doc2.getElementById("username").focus
Doc2.getElementById("username").Value = Trim(Text1.Text)
Doc2.getElementById("password").focus
Doc2.getElementById("password").Value = Trim(Text2.Text)
Doc2.getElementById("login_submit_btn").focus
Doc2.getElementById("login_submit_btn").Click
End If
End Sub
能不能把函数发给我学习一下,谢谢。850018252@qq.com 展开
'引用Microsoft HTML Object Library
Private Sub Command1_Click()
Dim Doc2 As HTMLDocument
Dim Web2 As WebBrowser_V1
Dim LikeUrl As String
LikeUrl = "<a href="https://mailsso.mxhichina.com/login.htm?app_code=smartmail&device_id=" target="_blank">https://mailsso.mxhichina.com/login.htm?app_code=smartmail&device_id=</a>*"
Set Web2 = GetFrameLikeUrl(Web1.Document, LikeUrl)
If Not Web2 Is Nothing Then
Set Doc2 = Web2.Document
Doc2.getElementById("username").focus
Doc2.getElementById("username").Value = Trim(Text1.Text)
Doc2.getElementById("password").focus
Doc2.getElementById("password").Value = Trim(Text2.Text)
Doc2.getElementById("login_submit_btn").focus
Doc2.getElementById("login_submit_btn").Click
End If
End Sub
能不能把函数发给我学习一下,谢谢。850018252@qq.com 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询