Vbscript 用VBS提交Google表单

Vbscript 用VBS提交Google表单,vbscript,Vbscript,这是我的代码自动填写表格,但我似乎没有使它工作。另外,我不知道如何调用submit按钮并按下它。这应该可以让您开始 On Error Resume Next Const PAGE_LOADED = 4 Set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzK

这是我的代码自动填写表格,但我似乎没有使它工作。另外,我不知道如何调用submit按钮并按下它。

这应该可以让您开始

On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzKxjG87BblRky7hQ/viewform")
objIE.Visible = True

WScript.Sleep(3000) 

IE.Document.getElementById("entry.1790931838").Value = "msdasdadm"
Submit按钮实际上是一个父DIV元素,定义了一个关联的JS onclick事件处理程序。但是,请注意jsname属性,因为随机名称很可能在表单之间更改


希望这有帮助。

如果我有多个输入空格,我应该如何更改For循环?jsname属性很可能对每个表单元素都是唯一的,包括多个输入文本块。为每个jsname添加条件检查,并相应地填充input.value。您可以引用上面的代码(在divsfor循环中)作为检查jsname属性的示例。享受
<span jsslot="" class="appsMaterialWizButtonPaperbuttonContent exportButtonContent"><span class="appsMaterialWizButtonPaperbuttonLabel quantumWizButtonPaperbuttonLabel exportLabel">Submit</span></span>
On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzKxjG87BblRky7hQ/viewform")
objIE.Visible = True

WScript.Sleep(3000) 

IE.Document.getElementById("entry.1790931838").Value = "msdasdadm"
On Error Resume Next

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzKxjG87BblRky7hQ/viewform")
objIE.Visible = True

WScript.Sleep(3000) 

Dim input, inputs : Set inputs = objIE.document.getElementsByTagName("INPUT")
For Each input In inputs
    If ("text" = input.getAttribute("type")) Then
        input.value = "Just a test"
        Exit For
    End If
Next

Dim div, divs : Set divs = objIE.document.getElementsByTagName("DIV")
For Each div In divs
    If ("button" = div.getAttribute("role") And "M2UYVd" = div.getAttribute("jsname")) Then
        Call div.click()
        Exit For
    End If
Next