帮忙解释一段代码。谢谢!!
Sub test()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://www.sephora.cn/?rsour=baidu&rmeth=brandzone&rterm=title&rcamp=title&_sv_code=36_1938477_134848278|{creative}|{domain}"
DoEvents
While .busy
DoEvents
Wend
With .Document
.GetElementById("username").Value = "hyangyang0613"
.GetElementById("password").Value = "hyy379509"
.GetElementById("loginsubmit").Click
End With
End With
End Sub
[解决办法]
Sub test()With CreateObject("InternetExplorer.Application") '创建IE对象 .Visible = True '可见 .navigate "http://www.sephora.cn/?rsour=baidu&rmeth=brandzone&rterm=title&rcamp=title&_sv_code=36_1938477_134848278|{creative}|{domain}" '浏览这个网页 DoEvents '执行这个事件 While .busy '反复执行 DoEvents Wend With .Document .GetElementById("username").Value = "hyangyang0613" '给用户名的文本框的值赋值 .GetElementById("password").Value = "hyy379509" '密码 .GetElementById("loginsubmit").Click '点击登陆按钮 End WithEnd WithEnd Sub