PDA

View Full Version : VBA help - not sure which getelement to use for scraping website



ajeddine
09-05-2018, 06:13 PM
Good afternoon VBAexpress forums,

I have the following vba script that I need help with. I am trying to toggle the Multi-family check box in the drop down menu but I am unable to get that to work so far. Any insight would be greatly appreciated!

Dim appIE As Object


Set appIE = New InternetExplorer


With appIE
.Navigate "https://www.realtor.com/"
.Visible = True
End With


'while the webpage is loading
Do While appIE.Busy = True Or appIE.readyState <> 4: DoEvents: Loop


'Once the page is loaded, fill in the search bar with Jacksonville, FL
appIE.document.getElementById("searchBox").Value = "Jacksonville, FL"
'Click the search button
Set Search_Button = appIE.document.getElementsByClassName("btn btn-primary js-searchButton")(0)
Search_Button.Click
'Change the type to multifamily
appIE.document.getElementById ("desktop-facet-property-type")