Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Select dropdown menu in website using libreCalc macro

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")
    Set pr=propertytype(2).getElementsByTagName("option")
   For i=0 to pr.Length-1
      If (pr(i).innerText = "Industrial") Then
           pr.SelectedValue()="True"
          Exit For
       End If
     Next

   Set  submitlink = html.getElementsByClassName("btn btn-large btn-block btn-darkgray")
   if(submitlink(0).innerText="Search") Then
      ie.Navigate submitlink
      Do While ie.ReadyState <> 4
     Doevents
   Loop

    End If

   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.

Select dropdown menu in website using libreCalc macro

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(2).getElementsByTagName("option")
pr=propertytype(4).getElementsByTagName("option")



         MsgBox pr.Length

        For i=0 to To pr.Length-1
           MsgBox pr(i).innerText

         If (pr(i).innerText = "Industrial") (InStr(pr(i).innerText,"Industrial")>0) Then
           pr.SelectedValue()="True"
  
         pr.Select="True"

        Exit For
        End If
      Next

    Set  submitlink = html.getElementsByClassName("btn btn-large btn-block btn-darkgray")
   if(submitlink(0).innerText="Search")       For Each submit In submitlink
         if(submit.innerText="Search") Then
       ie.Navigate submitlink
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.