【发布时间】:2016-06-02 18:47:55
【问题描述】:
我不知道如何点击此页面上的“Next 100”按钮:
特别是本节:
<form>
<table border="0" width="100%">
<tbody><tr>
<td>Items 1 - 100 <a href="/cgi-bin/browse-edgar?action=getcompany&CIK=0000898293&type=&dateb=&owner=exclude&start=0&count=100&output=atom"><img src="/images/rss-feed-icon-14x14.png" alt="0000898293 Filings" border="0" align="top"> RSS Feed</a></td>
<td style="text-align: right;"> <input type="button" value="Next 100" onclick="parent.location='/cgi-bin/browse-edgar?action=getcompany&CIK=0000898293&type=&dateb=&owner=exclude&start=100&count=100'"></td>
</tr>
</tbody></table>
</form>
以下是我在excel VBA中厌倦的内容,我对此没有深入的了解,并且如果我能看到元素ID,我知道如何单击按钮。
Sub dates()Dim IE As New InternetExplorer
IE.Visible = True
IE.navigate "http://www.sec.gov/cgi-bin/browse-edgar?CIK=JBL&owner=exclude&action=getcompany"
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Doc.getElementById("count").Value = 100
Doc.forms.Item(0).submit
Dim objTag As Object
For Each objTag In Doc.getElementsByTagName(strTagName)
If InStr(objTag.outerHTML, "Next 100") > 0 Then
objTag.Click
objTag.FireEvent ("onclick")
Exit For
End If
Next
【问题讨论】:
标签: excel internet-explorer vba