PDA

View Full Version : VBA - Tick/untick the direct, 1 stop, 2+ stop checkboxes within Skyscanner



fatboy_1989
06-07-2017, 12:59 AM
Hello,

For any flight selected in Skyscanner I want to only show direct flights and want to know how to do this via excel VBA. So I want "Direct" to be checked but "1 stop" and "2+ stops" to be unchecked.

The HTML code i've located which may help with the VBA required for the "Direct", "1 Stop" and "2+ Stops" is:

An example webpage might be: https://www.skyscanner.net/transport/flights/lond/hkg/170825/170903

<-- li data-id="direct" -->
<--label class="clearfix two-line"-->
<--span class="label-text"-->Direct
<--input type="checkbox" checked="checked"-->
<--span class="filter-sub">£111
<--/label-->
<--/li-->

<--li data-id="one_stop"-->
<--label class="clearfix two-line"-->
<--span class="label-text">1 stop
<--input type="checkbox" checked="checked"-->
<--span class="filter-sub"-->£163
<--/label>
<--/li>

<--li data-id="two_plus_stops"-->
<--label class="clearfix two-line"-->
<--span class="label-text"-->2+ stops
<--input type="checkbox" checked="checked"-->
<--span class="filter-sub">£197
<--/label-->
<--/li-->

Note: I have replaced "<" and ">" with "<--" and "-->" because not doing this meant it actually shows a checkbox in the message!!
Many thanks

fatboy_1989
06-07-2017, 01:00 AM
Link: https://www.mrexcel.com/forum/excel-questions/1008513-visual-basic-applications-tick-untick-direct-1-stop-2-stop-checkboxes-within-skyscanner.html#post4840879

fatboy_1989
06-07-2017, 01:03 AM
Note: There are links to mrexcel, ozgrid, excelforum, excelguru but the post is limited by number of URL's so cannot paste them here:

Mrexcel: Post number: 1008513
ozgrid: showthread.php?t=204346
excelforum: 1188271
excelguru: showthread.php?7907