Skip to content

Instantly share code, notes, and snippets.

@dergachev
Created September 9, 2013 17:52
Show Gist options
  • Save dergachev/6499119 to your computer and use it in GitHub Desktop.
Save dergachev/6499119 to your computer and use it in GitHub Desktop.
Extract a comma-separated list destinations from https://www.google.ca/search?q=direct+flights+from+TLV
//run this code after going to https://www.google.ca/search?q=direct+flights+from+TLV
var links = document.querySelectorAll('div.std a.l'); // the selector might need to be tweaked??
var destinations = [];
for (var i = 0; i < links.length; ++i) {
var item = links[i];
item = item.href.replace(/^.*to\+/,'').replace(/&.*/,'');
destinations.push(item);
}
console.log(destinations.join(","));
// now paste this into multi-destination search at http://matrix.itasoftware.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment