gargashish1994
New Member
- Joined
- Nov 18, 2017
- Messages
- 1
I want to select options on multiple pages using vba internet explorer and i am able to open multiple tabs and multiple links using vba but only able to navigate on first page. Please check the coding given below for your reference:-
Please provide any solution to navigate on second page as well i need to again check non stop option on second tab.
Code:
<code>Sub mmtlink2()
Dim IE As New SHDocVw.InternetExplorer
Dim st As String
Dim htmldoc As MSHTML.HTMLDocument
Dim i As Long, d As Long, b As Long
'Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
d = 2
For i = 1 To d
If i = 1 Then
IE.navigate "https://www.makemytrip.com/air/search?tripType=O&itinerary=BOM-DXB-D-02Dec2017&paxType=A-1&cabinClass=E"
Else
IE.Navigate2 "https://www.makemytrip.com/air/search?tripType=O&itinerary=BOM-DXB-D-03Dec2017&paxType=A-1&cabinClass=E", 2048
End If
Do While IE.Busy = True Or IE.readyState <> 4
Loop
Set htmldoc = IE.document
htmldoc.getElementById("Non stop").Click
Next i
End Sub</code>