The coding for select drop-down menu in website
Option VBASupport 1
Sub dropdown()
URL = "http://www.vaughtgroup.com/search-results/?alllistings#headeranchor"
Dim propertytype As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = "True"
ie.Navigate URL
Do While ie.ReadyState <> 4
DoEvents
Loop
Set html=ie.document.body
Set propertytype = html.getElementsByTagName("select")
MsgBox propertytype.Length
Set pr=propertytype(4).getElementsByTagName("option")
MsgBox pr.Length
For i=0 To pr.Length-1
MsgBox pr(i).innerText
If (InStr(pr(i).innerText,"Industrial")>0) Then
pr.Select="True"
Exit For
End If
Next
Set submitlink = html.getElementsByClassName("btn btn-large btn-block btn-darkgray")
For Each submit In submitlink
if(submit.innerText="Search") Then
ie.Navigate submit
Do While ie.ReadyState <> 4
Doevents
Loop
Exit For
End If
Next
End Sub
Here " pr.SelectedValue()=“True”" step is not executed. I don’t know how to select property type. If anyone knows that execution method, kindly shared to me.