Sub main()
'定义的浏览器变量
Dim ie, nsrsbh As Object
Dim i As Integer
'创建浏览器变量
ie = CreateObject("InternetExplorer.Application")
'显示浏览器
ie.Visible = True
ie.Navigate("http://dzswj.szgs.gov.cn/BsfwtWeb/apps/views/login/login.html") '打开网页
While ie.ReadyState <> 4 Or ie.Busy = True '检测浏览器是否完全打开
Application.DoEvents() '假如浏览器还没有完全打开,则等待
End While
nsrsbh = ie.Document.getElementById("nsrsbh")
MsgBox(nsrsbh.tagName)
ie.Document.getElementById("nsrsbh").Value = "440300667081995"
ie.Document.getElementById("nsrpwd").value = "9238871"
End Sub