Skip to content

Instantly share code, notes, and snippets.

@vamdt
Created January 1, 2014 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamdt/8208598 to your computer and use it in GitHub Desktop.
Save vamdt/8208598 to your computer and use it in GitHub Desktop.
'autologin.vbs
'自动打开某网站并填写表单
Dim ie
Set ie=CreateObject("InternetExplorer.Application") '创建IE应用程序对象
ie.Visible=True '设置IE窗体可见
ie.Navigate "http://www.xxt.cn" '导航到相应网站
While ie.busy Or ie.readystate <> 4 '等待网页加载完毕
Wend
'填写表单并点击登录
ie.document.frames(0).document.loginForm.userName.value="username"
ie.document.frames(0).document.loginForm.password.value="password"
ie.document.frames(0).document.loginForm.button.click()
'1.首先创建IE对象,设定IE可见,并导航到相应网站。
'2.检测ie当前的页面是否加载完毕
'3.根据document对象填写登录表单
'4.点击登录按钮进行登录
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment