gpt4 book ai didi

javascript - 使用 Excel VBA 提交 Javascript 中的按钮

转载 作者:行者123 更新时间:2023-11-30 16:57:07 25 4
gpt4 key购买 nike

我似乎无法提交单击提交或继续按钮。它似乎在 javascript 下,我不确定如何输入代码以单击“开始”按钮。这是我所拥有的:

Sub FactFinderForm()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.
IE.Navigate "http://factfinder.census.gov/faces/nav/jsf/pages/index.xhtml###"
'go to web page listed inside quotes
IE.Visible = True

While IE.busy
DoEvents 'wait until IE is done loading page.
Wend

IE.Document.getElementsByname("cfsearchtextboxmain").Item.innertext = _
ThisWorkbook.Sheets("sheet1").Range("a1")

While IE.readyState <> 4
DoEvents
Wend

SendKeys "{enter}"

End Sub

最佳答案

试试这个:

With IE.Document

.getElementById("cfsearchtextboxmain").Value = _
ThisWorkbook.Sheets("sheet1").Range("a1").Value

.parentWindow.ExecScript "cfMainFormSubmit()"

End With

关于javascript - 使用 Excel VBA 提交 Javascript 中的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29525345/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com