Last active
December 8, 2015 03:28
-
-
Save leodutra/bfa418171cde434caffa to your computer and use it in GitHub Desktop.
Wikipedia ISO 3166-1 code list scrapper (https://en.wikipedia.org/wiki/ISO_3166-1)
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
var res = [] | |
$('.wikitable').first().find('tbody tr').each(function() { | |
var $td = $(this).find('td') | |
res.push({ | |
englishShortName: $td.eq(0).find('a').first().text(), | |
ISO_3166_1_Alpha_2_code: $td.eq(1).text(), | |
ISO_3166_1_Alpha_3_code: $td.eq(2).text(), | |
ISO_3166_1_Numeric_3_code: $td.eq(3).text() }); | |
}) | |
console.log(JSON.stringify(res)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment