如何用vb实现网页表单的自动填充并提交
展开全部
如果你电脑的的默认输入语言如果是五笔的话,下面的代码能实现运行后,打开hao123.com网页,并在百度一下的输入栏中写上“幸福一生”四个字。供你参考吧! Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Form_Load() Dim ie Set ie = CreateObject("internetexplorer.application") ie.Visible = True ie.navigate " http://www.hao123.com/" Set WshShell = CreateObject("wscript.shell") Sleep 500 WshShell.SendKeys "fupy" Sleep 500 WshShell.SendKeys "ggtg" Sleep 500 WshShell.SendKeys " " End Sub vb实现网页表单的自动填充并提交这个真的好难,本人水平有限只能做到这点 了,如有不足请指出,也希望我们大家共同来探讨!
展开全部
这个因网页HTML代码而定 如登陆126邮箱 Private Sub Form_Load() WebBrowser1.Navigate " www.126.com " End Sub Private Sub Command1_Click() Dim vDoc, vTag Dim i As Integer Set vDoc = WebBrowser1.Document For i = 0 To vDoc.All.length - 1 aa = UCase(vDoc.All(i).tagName) If UCase(vDoc.All(i).tagName) = "INPUT" Then Set vTag = vDoc.All(i) If vTag.Type = "text" Or vTag.Type = "password" Then Select Case vTag.Name Case "user" vTag.Value = "帐号" Case "password" vTag.Value = "密码" End Select ElseIf vTag.Type = "submit" Then vTag.Click End If End If Next i End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询