I am trying to select a time from a time picker on a website with the excel VBA code below. While the code loops through it does not select 09. What am I doing wrong? Website code also below.
Set e = appIE.document.getElementbyid("timepicker-pickup").getElementsByTagName("li")
For Each e In e
If e.innerHTML = "09" Then
e.Click
End If
Next
Website code:
<div class="timepicker" id="timepicker-pickup">
<div class="arrow"></div>
<div class="icon close-btn"></div>
<div class="inner-time-picker clearfix">
<div class="section hours">
<div class="up-arrow"><span class="icon arrow"></span></div>
<div class="selectors">
<ul>
<li data-value="00">00</li>
<li data-value="01">01</li>
<li data-value="02">02</li>
<li data-value="03">03</li>
<li data-value="04">04</li>
<li data-value="05">05</li>
<li data-value="06">06</li>
<li data-value="07">07</li>
<li data-value="08" class="selected">08</li>
<li data-value="09">09</li>
<li data-value="10">10</li>
<li data-value="11">11</li>
</ul>
</div>
eas your container and your object. Try using a different name for the actual object i.e.For Each i In e. You can then tryi.Click