For one of my projects, i am trying to run a looped script (for and while) which would run until a particular predefined date value is reached. My code is aimed at extracting the flight data of an aircraft between two specified dates. My source of information is the publicly available flight tracker, <flightradar24.com>, for which i also have a business subscription. For example - https://www.flightradar24.com/data/aircraft/d-abyt When trying to collect a list of flights from the page, i want to be able to read a date and stop the loop if it is over the specified date.
The html source looks like the following:
In this case the 22 Mar 2020 is what I want to read and use to compare.
So far I've tried the following to try and extract the date.
element = driver.find_element_by_class_name('w40 hidden-xs hidden-sm')
print(driver.find_element_by_xpath("//time[@class='hidden-xs hidden-sm']").text)
print(driver.find_element_by_xpath("//time[@class='w40 hidden-xs hidden-sm']").get_attribute("data-time-format"))
and
element = driverfox.find_element_by_xpath('// time[ @class ="data-time-format"] / @ datetime'.__getattribute__("data-time-format"))