This is possible as a small extension to existing code.
I avoid using querySelector and querySelectorAll because they are scaly (for your other question reward).
I did not use Focus and used Click instead, since I assume that this runs regardless of what the script requires in the background.
Then you can manually select the correct index (using selectedIndex ) or search for children for the desired <label> value:
Work code:
Option Explicit Sub Soccer_Dropdown() Dim IE As New InternetExplorer, html As HTMLDocument Dim divElement As Object, selectElement As Object, optionElement As Object Dim optionIndex As Long Dim targetOption As String ' load page With IE .Visible = True .navigate "https://ubet.com/sports/soccer/nexttoplay" Do Until .readyState = 4: DoEvents: Loop Set html = .document End With ' let page do its thing Application.Wait Now + TimeValue("00:00:05") ' get the div Set divElement = html.getElementsByClassName("ubet-fixed-price-navigator-selector-league") ' get the select in the div Set selectElement = divElement(0).getElementsByTagName("select")(0) ' click it to activate any script to populate select selectElement.Click ' select by index - this works but showing the other technique below 'selectElement.selectedIndex = 9 ' select by iterating the options optionIndex = 0 targetOption = "Australia A-League" For Each optionElement In selectElement If LCase(optionElement.localName) = "option" And optionElement.Label = targetOption Then selectElement.selectedIndex = optionIndex Debug.Print targetOption & " at index " & optionIndex Exit For End If optionIndex = optionIndex + 1 Next ' quit IE 'IE.Quit End Sub
Edit
@QHarr - to your question How can Set selectElement = divElement (0) .getElementsByTagName ("select") (0) access the Australian League?
In the div containing the dropdown there is a class ubet-fixed-price-navigator-selector-league and that <div> has a single <select> element which is a dropdown list. Since getElementsByTagName returns a set of HTML elements, we just want to return the first <select> element to a <div> . Index 0 does not apply to the list of things in the drop-down list (i.e. <option> s). See HTML:

A bit further down the HTML, you can see the <option> elements (grouped into <optgroup> s), where you can access the dropdown values:

@Topto - a good question - the localName property, as well as several others for the optionElement variable, was what I could see in the Locals window as having an option value:

I think you could use nodeName same as localName . There is also tagName , which I suppose is the most obvious sound:

NTN
Robin mackenzie
source share