VBscript写入文本区域并提交

VBscript写入文本区域并提交,vbscript,Vbscript,我正试图写一个文本区,并提交后登录到一个网站。尝试附加文本区域时出错,是否有其他方法 第一个主要功能是运行良好-即打开并正确登录到网站。然后,我被移动到名为slackbot的页面,这里有文本区域。我可以将文本添加到字段中,但无法提交 守则: Const dirPath = "C:\Users\tim.mcgee\Desktop\Offsite Drive" Const alertedPath = "prevRun.txt" alertOn = 3 * 2 ^ 29 '

我正试图写一个文本区,并提交后登录到一个网站。尝试附加文本区域时出错,是否有其他方法

第一个主要功能是运行良好-即打开并正确登录到网站。然后,我被移动到名为slackbot的页面,这里有文本区域。我可以将文本添加到字段中,但无法提交

守则:

Const dirPath     = "C:\Users\tim.mcgee\Desktop\Offsite Drive"
Const alertedPath = "prevRun.txt"
      alertOn     = 3 * 2 ^ 29 '1.5GB
      resetOn     = alertOn * .95 'Approx 77MB
Const emailTo     = "temcgee7@gmail.com"
Const emailFrom   = "temcgee7@gmail.com"
Const emailSbjct  = "Offsite Drive Full"
Const emailMsg    = "The offsite drive has reached maximum capacity."
Const SMTPServer  = "smtp.gmail.com"
Const SMTPPort    = 465
      emailUsr    = emailFrom 
Const emailPsswd  = "Electricboat1"
Const emailSSL    = False


Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(alertedPath) Then
  alerted =  CBool(Trim(fso.OpenTextFile(alertedPath).ReadLine))
Else
  alerted = False
End If
dirSize = fso.GetFolder(dirPath).Size

If alerted Then 'Email previously sent
  alerted = dirSize > resetOn
ElseIf dirSize >= alertOn Then
  Call Main
  alerted = True
End If

fso.OpenTextFile(alertedPath, 2, True).WriteLine CInt(alerted)
WScript.Quit 0

Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "https://epic.slack.com/messages/@slackbot/"
    Wait IE
    With IE.Document
        .getElementByID("email").value = "tim.mcgee@epicgames.com"
        .getElementByID("password").value = "Electricboat1"
        .getElementByID("signin_btn").click()
    End With

    WScript.Sleep 5000

    Wait IE
    With IE.Document
        .getElementByID("message-input").appendChild(IE.Document.createtextnode("@channel: Offsite drive is reaching maximum capacity. Please delete old builds."))
        .getElementByID("message-input").submit()
    End With

End Function

Sub Wait(IE)
  Do
    WScript.Sleep 2000
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub
Const dirPath=“C:\Users\tim.mcgee\Desktop\Offsite Drive” Const alertedPath=“prevRun.txt” alertOn=3*2^29'1.5GB resetOn=alertOn*.95'约77MB Const emailTo=”temcgee7@gmail.com" Const emailFrom=”temcgee7@gmail.com" Const emailSbjct=“场外驱动器已满” Const emailMsg=“非现场驱动器已达到最大容量。” Const SMTPServer=“smtp.gmail.com” 常数SMTPPort=465 emailUsr=emailFrom Const emailPsswd=“Electricboat1” Const emailSSL=False 设置fso=CreateObject(“Scripting.FileSystemObject”) 如果存在fso.files(alertedPath),则 alerted=CBool(Trim(fso.OpenTextFile(alertedPath.ReadLine)) 其他的 警报=错误 如果结束 dirSize=fso.GetFolder(dirPath).Size 如果发出警报,则“以前发送的电子邮件” alerted=dirSize>resetOn ElseIf dirSize>=alertOn Then 呼叫总管 警报=真 如果结束 OpenTextFile(alertedPath,2,True).WriteLine CInt(alerted) WScript.0退出 主要功能 设置IE=WScript.CreateObject(“InternetExplorer.Application”、“IE”) 可见=真实 即“导航”https://epic.slack.com/messages/@slackbot/” 等等 用IE文件 .getElementByID(“电子邮件”).value=“tim。mcgee@epicgames.com" .getElementByID(“密码”).value=“Electricboat1” .getElementByID(“登录”)。单击() 以 WScript.Sleep 5000 等等 用IE文件 .getElementByID(“消息输入”).appendChild(即.Document.createtextnode(@channel:Offsite drive正在达到最大容量。请删除旧版本)。) .getElementByID(“消息输入”).submit() 以 端函数 分段等待(IE) 做 WScript.Sleep 2000 当IE.ReadyState<4且IE.Busy时循环 端接头