Private Sub Form_Load()
Me.WebBrowser1.Navigate2 "https://login.taobao.com/member/login.jhtml"
End SubPrivate Sub Command2_Click()
WebBrowser1.Document.getElementByID("TPL_username_1").Value = "yourname" '你的用户名 ''这句正确
WebBrowser1.Document.getElementByNAME("TPL_password").Value = "password" '你的密码 ''这句提示错误了
'由于密码中 id= 所以用name 但这句错误了,
End Sub
请问在<input 中没有ID 的怎么写?
还有是提交怎么写?谢谢!!
Me.WebBrowser1.Navigate2 "https://login.taobao.com/member/login.jhtml"
End SubPrivate Sub Command2_Click()
WebBrowser1.Document.getElementByID("TPL_username_1").Value = "yourname" '你的用户名 ''这句正确
WebBrowser1.Document.getElementByNAME("TPL_password").Value = "password" '你的密码 ''这句提示错误了
'由于密码中 id= 所以用name 但这句错误了,
End Sub
请问在<input 中没有ID 的怎么写?
还有是提交怎么写?谢谢!!
WebBrowser1.Document.getElementsByNAME("TPL_password")(0).Value = "password"
不知道能帮上楼上不.
代码示例:
webbrowser 控件中 修改网页源码Dim c As Integer
c = 0
If c = 1 Then Exit Sub ‘这个是为了防止这个过程无限执行下去
c = c + 1
Temp = WebBrowser1.Document.body.innerhtml
Temp = Replace(Temp, "<BUTTON title=我接受", "<BUTTON ID=abc title=我接受")
WebBrowser1.Document.body.innerhtml = TempWebBrowser1.Document.All("abc").Click
WebBrowser1.Document.All("TPL_password").Value = "Password"
不报错,但在XP sp3系统下,密码框输入为空,提示要安装个控件;
在windows 2003系统下,密码输入成功.