启动网站登录的 VBScript [英] VBScript to Launch a website login

查看:22
本文介绍了启动网站登录的 VBScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上找到了这个脚本,我编辑了大部分.

I found this script online, I edited most of it.

它可以输入用户名和密码,但无法点击登录.

It is able to enter username, and password on its down but it is not able to click login.

请帮我解决这里是登录论坛.

http://desistream.tv/en/index.shtml

这是脚本目前它在 IE 中,但我需要将其更改为在 Google Chrome 中打开.

Here is Script currently it is in IE but I will need to change it open in Google Chrome.

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://desistream.tv/en/index.shtml"
  Wait IE
  With IE.Document
    .getElementByID("login_username").value = "myusername"
    .getElementByID("login_password").value = "mypassword"
    .getElementByID("form").submit
  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy 
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub

推荐答案

这里是...

Call Main

Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "http://desistream.tv/en/index.shtml"
    Wait IE
    With IE.Document
        .getElementByID("username").value = "myusername"
        .getElementByID("pass").value = "mypassword"
        .getElementsByName("frmLogin")(0).Submit
    End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub

这篇关于启动网站登录的 VBScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆