【发布时间】:2015-09-20 23:58:47
【问题描述】:
我正在尝试访问一个网站,在文本框中输入一个值,然后单击搜索按钮来搜索我的值。 我的问题是,我无法获取按钮元素来触发点击事件。
VBA:
Dim i As Long
Dim objElement As Object
Dim objCollection As Object
Dim result(2) As String
Dim timeout As Integer
Dim test As Object 'testweise
If IE Is Nothing = False Then
IE.Quit
End If
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
Start:
' Send the form data To URL As POST binary request
IE.navigate "https://www.bundesanzeiger.de/ebanzwww/wexsservlet"
' Wait while IE loading...
Do While IE.Busy
DoEvents
Application.Wait DateAdd("s", 1, Now)
Loop
IE.Document.getElementbyid("genericsearch_param.fulltext").Value = "Mielke"
IE.Document.getElementbyid("(page.navid=to_quicksearchlist)").Click
HTML
<div class="bbg"><input name="(page.navid=to_quicksearchlist)" type="submit" alt="Suchen" value="Suchen"></div>
第二个 getElement 调用应该获取按钮,但对象为 null。 有谁知道我哪里做错了?
【问题讨论】:
标签: html vba getelementbyid