diddi
Well-known Member
- Joined
- May 20, 2004
- Messages
- 3,337
- Office Version
- 2010
- Platform
- Windows
hi all. i have an ie automation issue. the code (bottom) works fine. my problem is that there are multiple pages. it is possible to display all pages however by automating this portion of html:
i just cant seem to be able to find a way to implement it.
Code:
<a href="#" *******="document.linkForm11.submit();return false;">Next<b>-〉</b></a>   <form method=POST name=linkForm12 action="/search.php?page=all" style="display:inline; margin:0; padding:0;">
<input type="hidden" name="search_sn" value="">
<input type="hidden" name="search_sx" value="0">
<input type="hidden" name="search_gn" value="A">
<input type="hidden" name="search_lo" value="">
<input type="hidden" name="search_y1" value="1800">
<input type="hidden" name="search_y2" value="1850">
<input type="hidden" name="search_pu" value="">
<input type="hidden" name="search_st" value="">
<input type="hidden" name="search" value=1></form>
<a href="#" *******="document.linkForm12.submit();return false;">[Show All]</a> </div>
i just cant seem to be able to find a way to implement it.
Code:
MyURL = "http://ryersonindex.org/search.php"
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate MyURL
Do Until IE.Readystate = 4: DoEvents: Loop
IE.Visible = True
Set doc = IE.document
Set ElementCol = IE.document.getElementsByTagName("INPUT")
For Each btnInput In ElementCol
If btnInput.Type = "text" Then
If btnInput.Name = "search_gn" Then btnInput.Value = "A"
If btnInput.Name = "search_y1" Then btnInput.Value = "1800"
If btnInput.Name = "search_y2" Then btnInput.Value = "1850"
End If
Next btnInput
For Each btnInput In ElementCol
If btnInput.Name = "search" Then btnInput.Click
Next btnInput
Do Until IE.Readystate = 4: DoEvents: Loop