shahin
Active Member
I've written a macro to parse some information from a webpage. There are two iframes in that webpage to hurdle with. When the browser leads to the landing page it is necessary to switch the first "iframe" to be able to click on the "search by address" button. I've already switched that and then a box appears with two search fields: one is "street number" and the other is "street name". I've already filled in the two search fields. Now, when i click on the search button to reach the target page the browser no longer performs any activity. Here is an iframe attached to this "search" button which needs to be switched as well otherwise the button will not response. I'm totally stuck here. How can i click on this button and enter the target page? FYI, I've already caught that iframe and set it in a variable which is commented out in the below script now. I've attached two images (marked with pencils) to show what I meant so far if anything is unclear at this point. Thanks in advance.
Here is what I've written so far:
Here is what I've written so far:
Code:
Sub Hcad_Data()
Dim IE As New InternetExplorer, html As HTMLDocument
Dim elem As Object, frm As Object
With IE
.Visible = True
.navigate "http://hcad.org/quick-search/"
Do Until .readyState = READYSTATE_COMPLETE: Loop
Set elem = .document.getElementsByTagName("iframe")(0)
.navigate elem.src ''switching to another page to be able to click on the "search by address" button
Do Until .readyState = READYSTATE_COMPLETE: Loop
Set html = .document
End With
html.getElementById("s_addr").Click
Application.Wait (Now + TimeValue("0:00:05"))
html.getElementsByName("stnum")(0).Value = "8227"
html.getElementsByName("stname")(0).Value = "FINDLAY ST"
Do Until IE.readyState = READYSTATE_COMPLETE: Loop
html.getElementsByTagName("input")(3).Click ''no issues are there until this line
' Do Until IE.readyState = READYSTATE_COMPLETE: Loop
' Set frm = html.getElementById("quickframe") ''this is the iframe
Application.Wait (Now + TimeValue("0:00:05"))
' IE.Quit
End Sub