Skip to content

Instantly share code, notes, and snippets.

@kaffyzoo
kaffyzoo / gist:4c4b073811df1a96a5b5
Last active June 17, 2016 20:20
Scraping Google Travel Flights
var flights = $("div:contains('Best flights'):last").parent().children();
if (flights.length === 0) {
flights = $("div:contains('Choose an outbound'):last").parent().parent().children()[1];
flights = $($(flights).children()[0]).children();
}
var avg_time = 0;
var avg_price = 0;
flights.toArray().forEach(function (elm, ind, arr) {
if ($(elm).attr("iti") != undefined) {