excel VBA - Macro to click to the next page in IE -


i cannot figure out how click "next 100" button on page:

http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&cik=0000898293&type=&dateb=&owner=exclude&count=100

specifically section:

<form>      <table border="0" width="100%">         <tbody><tr>            <td>items 1 - 100&nbsp;&nbsp;<a href="/cgi-bin/browse-edgar?action=getcompany&amp;cik=0000898293&amp;type=&amp;dateb=&amp;owner=exclude&amp;start=0&amp;count=100&amp;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&amp;cik=0000898293&amp;type=&amp;dateb=&amp;owner=exclude&amp;start=100&amp;count=100'"></td>         </tr>      </tbody></table>   </form> 

below have tired in excel vba, don't have strong understanding of , know how click button if can see element id.

sub dates()dim ie new internetexplorer ie.visible = true  ie.navigate "http://www.sec.gov/cgi-bin/browse-edgar?cik=jbl&owner=exclude&action=getcompany"  doevents loop until ie.readystate = readystate_complete dim doc htmldocument set doc = ie.document   doc.getelementbyid("count").value = 100 doc.forms.item(0).submit   dim objtag object each objtag in doc.getelementsbytagname(strtagname) if instr(objtag.outerhtml, "next 100") > 0      objtag.click     objtag.fireevent ("onclick")      exit  end if next 

this should work you:

sub dates()     dim ie new internetexplorer      set ie = createobject("internetexplorer.application")      ie.visible = true     ie.navigate "http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&cik=0000898293&type=&dateb=&owner=exclude&count=100"              doevents     loop until ie.readystate = readystate_complete      ie.document         set elems = .getelementsbytagname("input")         each e in elems             if e.type = "button" , e.value = "next 100"                 e.click                 exit             end if         next e     end end sub 

if using following link :

http://www.sec.gov/cgi-bin/browse-edgar?cik=jbl&owner=exclude&action=getcompany 

you'll have check for

if objcollection(i).type = "button" , objcollection(i).value = "next 40" 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo