leodutra
12/8/2015 - 3:14 AM

Wikipedia ISO 3166-1 code list scrapper (https://en.wikipedia.org/wiki/ISO_3166-1)

Wikipedia ISO 3166-1 code list scrapper (https://en.wikipedia.org/wiki/ISO_3166-1)

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))