【发布时间】:2017-01-02 04:30:58
【问题描述】:
使用 VBA,我正在尝试以编程方式将 https://data.seattle.gov/Permitting/Electrical-Permits-Current/raim-ay5x 处的搜索词输入到输入元素中。只需输入 ieInput.value= "RENEWABLE ENERGY" 然后 ieInput.click 不会触发过滤器。
有什么想法吗?
我的测试代码:
子 EnterSearchTerm()
Dim ieApp As InternetExplorer
If ieApp Is Nothing Then Set ieApp = New InternetExplorerMedium
ieApp.navigate "https://data.seattle.gov/Permitting/Electrical-Permits-Current/raim-ay5x"
ieApp.Visible = True
While ieApp.Busy: DoEvents: Wend
While ieApp.readyState <> READYSTATE_COMPLETE: DoEvents: Wend
Dim ieInput As HTMLInputElement
Set ieInput = ieApp.document.getElementsByClassName("searchField textPrompt prompt")(0)
ieInput.Value = "RENEWABLE ENERGY"
ieInput.Click
结束子
谢谢
【问题讨论】:
标签: html vba internet-explorer web-scraping