-
Solved: Controlling a webpage dropdown
Hi,
First of all, glad to be a member of the forum. I hope to contribute by helping others solve their cases and to get some valuable knowledge.
I have some trouble in navigating a webpage from vba. I have done similar things in the past, but they were rather simpler.
On the orange 'carhire' tab I would like to fill the input boxes / drop down list with variables and then click 'search'. The first two (pickup country and airport) seem to be a cascade lists - airport depends on the country you choose and in some cases there are more than two dependant fields after the country (town/cities and location), like for UK.
Here is the code I have tried. It seems to work for some fields, but not for all. WEBPAGE is 'travelsupermarket <dot> com'
Thank you for your help
[vba]
Sub TS1()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
ie.navigate WEBPAGE
While ie.busy
DoEvents
Wend
Application.Wait (Now + TimeValue("0:00:04"))
ie.document.getElementById("container_ucCarHireSHPGadget_ddlCountry").Value = "USA"
'pickupCountry ////does not work
ie.document.getElementById("container_ucCarHireSHPGadget_calPickUpDate").Va lue = "01/08/2012"
'pickUpDate
ie.document.getElementById("container_ucCarHireSHPGadget_calDropOffDate").V alue = "05/08/2012"
'dropOffDate
ie.document.getElementById("container_ucCarHireSHPGadget_ddlCarType").Value = "Economy"
'carType ////does not work
ie.document.getElementById("container_ucCarHireSHPGadget_ddlDriverAge").Val ue = "30"
'age
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules