+ Reply to Thread
Results 1 to 5 of 5

VBA - Change the outbound and return times on Skyscanner

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    VBA - Change the outbound and return times on Skyscanner

    Hello

    How can I change the outbound and return flight time ranges in Skyscanner within VBA?

    E.g. for the following flight: https://www.skyscanner.net/transport.../170921/170928

    I want to in Excel VBA, change the outbound and return times ranges as follows:

    Outbound: 08:30 - 16:00
    Return: 15:00 - 19:00

    For information, the time ranges can be changed on the left hand side menu once clicked the link above

    Thanks

    Cross Links
    http://www.ozgrid.com/forum/showthread.php?t=204244
    http://www.vbaexpress.com/forum/show...-on-Skyscanner
    http://www.excelguru.ca/forums/showt...2159#post32159
    https://www.excelforum.com/excel-pro...ml#post4664578
    https://www.mrexcel.com/forum/excel-...ml#post4835422
    Last edited by fatboy1989; 05-29-2017 at 04:09 PM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA - Change the outbound and return times on Skyscanner

    It seems the link to skyscanner does not work
    Last edited by PCI; 05-28-2017 at 04:31 PM.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    01-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA - Change the outbound and return times on Skyscanner

    I've edited the original post but the actual flight is not that important, just being able to change the time ranges for the outward and return flights.

    Try this link
    https://www.skyscanner.net/transport.../170921/170928

  4. #4
    Registered User
    Join Date
    01-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA - Change the outbound and return times on Skyscanner

    This may help get an answer or help understand what I am trying to do:

    1) Open the skyscanner link in internet explorer
    2) Press F12 to open the webpage HTML
    3) Select the "DOM Explorer" tab
    4) Press Ctrl+B so that you can select a part of the webpage
    5) Select the Outbound slider bar right handle (can be found on the LHS of the webpage)
    6) It should highlight:

    7) Just above this line is a line that ends with something like .....style="left:100%;">
    8) If you move the slider bar, this value changes
    9) The00:00 – 23:59
    also changes when you move the slider right handle
    10) It should be the values in either 8) or 9) that I want to be able to change/update via VBA

    Note the following will get the time range values that it is currently:

    Sub ChangeSkyscannerOutwardTimes()
    Dim IeApp As Object
    Set IeApp = CreateObject("InternetExplorer.Application")
    IeApp.Visible = True
    IeApp.navigate "https://www.skyscanner.net/transport/flights/Lond/BERL/170721/170729"
    divElem1 = IeApp.document.getElementsByClassName("noUi-origin noUi-connect")
    OutwardTimeLeftHandleValue = divElem1.Style.cssText
    divElem2 = IeApp.document.getElementsByClassName("noUi-origin noUi-background")
    OutwardTimeRightHandleValue = divElem2.Style.cssText
    IeApp.Quit
    End Sub()

  5. #5
    Registered User
    Join Date
    01-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA - Change the outbound and return times on Skyscanner

    I have found the rows and have updated the outward and return flight times in the HTML code BUT when I refresh the page, it defaults back to the original times: "00:00 - 23:59". How can I refresh the page so that it now uses what values i've input?

    The lines of code relevant are:

    IeApp.document.getElementsByClassName("filter-opts slider-opts")(0).getElementsByTagName("div")(0).INNERTEXT = "10:00 – 12:00"
    IeApp.document.getElementsByClassName("filter-opts slider-opts")(1).getElementsByTagName("div")(0).INNERTEXT = "08:00 – 22:00"
    IeApp.Refresh 'Note this refreshes the webpage but reverts the time ranges i've changed above back to "00:00 - 23:59"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Macro - Extract Price and Flight Info from Skyscanner
    By fatboy1989 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2017, 03:10 AM
  2. Replies: 4
    Last Post: 10-20-2016, 12:48 PM
  3. Outbound Schedule - Delay and on-time orders
    By kapo101 in forum Excel General
    Replies: 3
    Last Post: 04-01-2016, 06:48 AM
  4. [SOLVED] Outbound Calls per hour by agent
    By Cocohantas in forum Excel General
    Replies: 4
    Last Post: 03-22-2016, 07:11 AM
  5. Are your outbound emails working?
    By tfurnivall in forum Suggestions for Improvement
    Replies: 1
    Last Post: 12-02-2015, 06:25 PM
  6. Less then, return zero, equal or higher return value times 2 plus 50
    By Simale in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2014, 09:42 AM
  7. If a search term can be found 1 time, 2 times 3 times 4 times 5 times
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2013, 09:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1