Created
October 22, 2016 21:11
-
-
Save audacus/9204d77fb94a8fda43be23746f4bdcc2 to your computer and use it in GitHub Desktop.
Get fuel prices from http://www.garage-howald.ch/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFuelPrices() { | |
var tableBody = document.querySelectorAll('body table table table table')[1].childNodes[1]; | |
var data = []; | |
for (var i = 1; i <= 5; i = i + 2) { | |
var row = { | |
label: tableBody.childNodes[i].childNodes[1].childNodes[0].data, | |
price: tableBody.childNodes[i].childNodes[3].childNodes[0].data | |
}; | |
data.push(row); | |
} | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment