后台自动登录网页vb脚本实例代码

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

set IE=createobject("Internetexplorer.application")

IE.Visible = True

IE.Navigate "https:///login.htm"

‘等待网页加载完成

While IE.busy Or IE.readystate<>4

Wend

'从网页元素中找到设置的元素,并赋值

'因为form没有name或id,只能从document的collection里取forms集合

'再从中定位输入框和提交按钮

IE.Document.Forms(0).elements("name").value = "aaaa"

IE.Document.Forms(0).elements("passwd").value = "1111"

IE.Document.Forms(0).elements("Send").click

'登录后界面是框架结构,先等主框架加载完成

While IE.busy Or IE.readystate<>4

Wend

'等框架内网页1加载完成

While IE.busy Or IE.Document.Frames(1).document.readystate<>"complete"

Wend

'点击一个图片按钮/链接,需要先定位到框架内,再从document的collection里取images集合IE.Document.Frames(1).document.images(3).click

'等主框架加载完成

While IE.busy Or IE.readystate<>4

Wend

'等框架内网页2加载完成

While IE.busy Or IE.Document.Frames(2).document.readystate<>"complete"

Wend

'定位select控件,并作出选择

IE.Document.Frames(2).document.Forms(0).elements("lst_ed_day").selectedIndex=8

IE.Document.Frames(2).document.Forms(0).elements("lst_st_time").selectedIndex=1

'其他操作。。。。

=======================================================

html元素属性可以参阅/en-us/library/ms533050(vs.85).aspx InternetExplorer Object可参阅:/en-us/library/aa752084(VS.85).aspx

相关文档
最新文档