I am trying to automate this website using VBA excel. I am struck at a point where I have to select value from the dropdown box. I am very much new to VBA and tis is my 1st such project. this is what I have coded to select the value.
Sub automaticformfilling_ASDA()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
'to make sure that the website is properly loaded
With ie
.Visible = True
.navigate "https://www.argos-pet-insurance.com/quoteAndBuy.do?e=e1s1&curPage=captureDetails&rakT=1510852044896.1391473424.994101.1731.881880349.846|tsid:9904"
Do While .Busy
DoEvents
Loop
Do While .readyState <> 4
DoEvents
Loop
End With
Set Title = i.e.document.getElementById("yourDetailsPolicyHolderTitle")
For i = 1 To Title.Options.Length
If Title.Options(i).Text = "Mrs" Then
Exit For
End If
Next i
End Sub
Here is the HTML of that section:
<select name="policyHolder.title" class="select-large" id="yourDetailsPolicyHolderTitle" data-di-field-id="policyHolderTitle">
<option selected="selected" value="">Please select</option>
<option value="NWA_PET_T5">Dr</option>
<option value="NWA_PET_T3">Miss</option>
<option value="NWA_PET_T1">Mr</option>
<option value="NWA_PET_T2">Mrs</option>
<option value="NWA_PET_T4">Ms</option>
</select>
Title.selectedindex = 4.