Open xuyuji9000 opened 2 years ago
Get each country population.
Extract each country population information from this List of countries and dependencies by population From
// CSS selector
document.querySelectorAll(".wikitable tbody tr")
document.querySelectorAll(".wikitable tbody tr:first-child td:nth-child(2) b")[0].textContent
var country_population_array_1 = []
document.querySelectorAll(".wikitable tbody tr").forEach((element, index) => {
if(index > 0) {
let country = element.querySelectorAll("td a")[0].text;
let population = element.querySelectorAll("td:nth-child(4)")[0].textContent;
this.country_population_array_1.push(`${country}, ${population}`)
}
}, {country_population_array_1: country_population_array_1});
console.log(country_population_array_1)
output
[
"China, 1,412,600,000",
"India, 1,388,678,049",
"United States, 333,315,898",
"Indonesia, 271,350,000",
"Pakistan, 225,200,000",
"Brazil, 214,421,400",
"Nigeria, 211,401,000",
"Bangladesh, 172,304,494",
"Russia, 145,478,097",
"Mexico, 126,014,024",
"Japan, 125,340,000",
"Ethiopia, 117,876,000",
"Philippines, 111,562,463",
"Egypt, 102,993,446",
"Vietnam, 98,510,000",
"DR Congo, 92,378,000",
"Iran, 85,238,075",
"Turkey, 84,680,273",
"Germany, 83,222,442",
"France, 67,813,000",
"United Kingdom, 67,081,234",
"Thailand, 66,759,467",
"South Africa, 60,142,978",
"Tanzania, 59,441,988",
"Italy, 59,045,521",
"Myanmar, 55,294,979",
"South Korea, 51,671,569",
"Colombia, 51,049,498",
"Kenya, 47,564,296",
"Spain, 47,394,223",
"Argentina, 45,808,747",
"Algeria, 45,400,000",
"Sudan, 44,235,005",
"Uganda, 42,885,900",
"Iraq, 41,190,700",
"Ukraine, 41,167,336",
"Canada, 38,599,988",
"Poland, 38,116,000",
"Morocco, 36,530,748",
"Uzbekistan, 35,403,250",
"Saudi Arabia, 35,013,414",
"Peru, 33,035,304",
"Afghanistan, 32,890,171",
"Malaysia, 32,700,600",
"Angola, 32,097,671",
"Mozambique, 30,832,244",
"Ghana, 30,792,608",
"Yemen, 30,491,000",
"Nepal, 29,192,480",
"Venezuela, 28,705,000",
"Ivory Coast, 27,087,732",
"Madagascar, 26,923,353",
"Australia, 25,957,519",
"North Korea, 25,660,000",
"Cameroon, 24,348,251",
"Niger, 24,112,753",
"Taiwan, 23,375,314",
"Sri Lanka, 22,156,000",
"Burkina Faso, 21,510,181",
"Mali, 20,856,000",
"Chile, 19,678,363",
"Romania, 19,186,201",
"Kazakhstan, 19,171,952",
"Malawi, 18,898,441",
"Zambia, 18,400,556",
"Syria, 18,276,000",
"Ecuador, 17,929,248",
"Netherlands, 17,695,681",
"Senegal, 17,223,497",
"Guatemala, 17,109,746",
"Chad, 16,818,391",
"Somalia, 16,360,000",
"Zimbabwe, 15,790,716",
"Cambodia, 15,552,211",
"South Sudan, 13,249,924",
"Rwanda, 12,955,768",
"Guinea, 12,907,395",
"Burundi, 12,574,571",
"Benin, 12,506,347",
"Bolivia, 11,797,257",
"Tunisia, 11,746,695",
"Haiti, 11,743,017",
"Belgium, 11,617,817",
"Cuba, 11,181,595",
"Jordan, 11,155,472",
"Greece, 10,678,632",
"Dominican Republic, 10,535,535",
"Czech Republic, 10,524,167",
"Sweden, 10,452,326",
"Portugal, 10,347,892",
"Azerbaijan, 10,156,366",
"Hungary, 9,689,000",
"Honduras, 9,546,178",
"Tajikistan, 9,504,000",
"United Arab Emirates, 9,503,738",
"Israel, 9,481,340",
"Belarus, 9,349,645",
"Papua New Guinea, 9,122,994",
"Austria, 8,979,894",
"Switzerland, 8,717,105",
"Sierra Leone, 8,297,882",
"Togo, 7,886,000",
"Hong Kong, 7,394,700",
"Paraguay, 7,353,038",
"Laos, 7,337,783",
"Libya, 6,959,000",
"Serbia, 6,871,547",
"El Salvador, 6,825,935",
"Lebanon, 6,769,000",
"Kyrgyzstan, 6,663,000",
"Nicaragua, 6,595,674",
"Bulgaria, 6,520,314",
"Turkmenistan, 6,118,000",
"Denmark, 5,873,420",
"Congo, 5,657,000",
"Central African Republic, 5,633,412",
"Finland, 5,519,255",
"Singapore, 5,453,600",
"Slovakia, 5,452,025",
"Norway, 5,425,270",
"Palestine, 5,227,193",
"Costa Rica, 5,163,038",
"New Zealand, 5,132,860",
"Ireland, 5,011,500",
"Kuwait, 4,670,713",
"Liberia, 4,661,010",
"Oman, 4,527,446",
"Panama, 4,278,500",
"Mauritania, 4,271,197",
"Croatia, 3,888,529",
"Georgia, 3,728,573",
"Eritrea, 3,601,000",
"Uruguay, 3,554,915",
"Mongolia, 3,425,157",
"Bosnia and Herzegovina, 3,320,954",
"Puerto Rico, 3,285,874",
"Armenia, 2,963,900",
"Albania, 2,829,741",
"Qatar, 2,799,202",
"Lithuania, 2,794,961",
"Jamaica, 2,734,093",
"Moldova, 2,597,100",
"Namibia, 2,550,226",
"Gambia, 2,487,000",
"Botswana, 2,410,338",
"Gabon, 2,233,272",
"Lesotho, 2,159,000",
"Slovenia, 2,108,977",
"Latvia, 1,874,900",
"North Macedonia, 1,832,696",
"Kosovo, 1,782,115",
"Guinea-Bissau, 1,646,077",
"Equatorial Guinea, 1,505,588",
"Bahrain, 1,501,635",
"Trinidad and Tobago, 1,367,558",
"Estonia, 1,330,068",
"East Timor, 1,317,780",
"Mauritius, 1,266,334",
"Eswatini, 1,172,000",
"Djibouti, 976,107",
"Fiji, 898,402",
"Cyprus, 888,005",
"Comoros, 758,316",
"Bhutan, 756,129",
"Guyana, 743,699",
"Solomon Islands, 728,041",
"Macau, 682,300",
"Luxembourg, 634,730",
"Montenegro, 621,306",
"Western Sahara, 612,000",
"Suriname, 598,000",
"Cape Verde, 563,198",
"Malta, 514,564",
"Belize, 430,191",
"Brunei, 429,999",
"Bahamas, 393,450",
"Maldives, 383,135",
"Northern Cyprus, 382,230",
"Iceland, 376,000",
"Transnistria, 306,000",
"Vanuatu, 301,295",
"Barbados, 288,000",
"French Polynesia, 279,890",
"New Caledonia, 273,674",
"Abkhazia, 245,424",
"São Tomé and Príncipe, 214,610",
"Samoa, 199,853",
"Saint Lucia, 178,696",
"Guam, 153,836",
"Curaçao, 153,671",
"Republic of Artsakh, 148,900",
"Kiribati, 120,740",
"Grenada, 113,000",
"Aruba, 111,050",
"Saint Vincent and the Grenadines, 110,696",
"Jersey, 107,800",
"Micronesia, 105,754",
"Tonga, 99,532",
"Antigua and Barbuda, 99,337",
"Seychelles, 99,202",
"U.S. Virgin Islands, 87,146",
"Isle of Man, 84,069",
"Andorra, 79,535",
"Dominica, 72,000",
"Cayman Islands, 65,786",
"Bermuda, 64,055",
"Guernsey, 63,124",
"Greenland, 56,562",
"Marshall Islands, 54,516",
"Saint Kitts and Nevis, 54,000",
"Faroe Islands, 53,664",
"South Ossetia, 53,532",
"American Samoa, 49,710",
"Northern Mariana Islands, 47,329",
"Turks and Caicos Islands, 44,542",
"Sint Maarten, 42,577",
"Liechtenstein, 39,151",
"Monaco, 38,350",
"Gibraltar, 34,000",
"San Marino, 33,685",
"Saint Martin, 32,489",
"Åland, 30,344",
"British Virgin Islands, 30,000",
"Palau, 17,957",
"Cook Islands, 15,342",
"Anguilla, 15,000",
"Nauru, 11,832",
"Wallis and Futuna, 11,369",
"Tuvalu, 10,679",
"Saint Barthélemy, 10,289",
"Saint Helena, Ascension and Tristan da Cunha, 6,000",
"Saint Pierre and Miquelon, 5,974",
"Montserrat, 5,000",
"Falkland Islands, 4,000",
"Christmas Island, 1,966",
"Norfolk Island, 1,734",
"Niue, 1,549",
"Tokelau, 1,501",
"Vatican City, 825",
"Cocos (Keeling) Islands, 573",
"Pitcairn Islands, 40"
]
Number of countries voted for the UN resolution
Afghanistan, Albania, Andorra, Antigua and Barbuda, Argentina, Australia, Austria, Bahamas, Belgium, Belize, Bosnia and Herzegovina, Botswana, Bulgaria, Canada, Chile, Colombia, Costa Rica, Croatia, Cyprus, Czechia, Democratic Republic of the Congo, Denmark, Dominican Republic, Ecuador, Estonia, Fiji, Finland, France, Gambia, Georgia, Germany, Ghana, Greece, Grenada, Guatemala, Guyana, Haiti, Hungary, Iceland, Indonesia, Ireland, Israel, Italy, Jamaica, Japan, Kiribati, Kuwait, Latvia, Liberia, Liechtenstein, Lithuania, Luxembourg, Malawi, Malta, Marshall Islands, Micronesia(Federated States of), Monaco, Montenegro, Myanmar, Netherlands, New Zealand, Niger, North Macedonia, Norway, Palau, Panama, Papua New Guinea, Paraguay, Peru, Poland, Portugal, Qatar, Republic of Korea, Republic of Moldova, Romania, Saint Kitts and Nevis, Samoa, San Marino, Singapore, Slovakia, Slovenia, Spain, Suriname, Sweden, Switzerland, Timor-Leste, Tonga, Trinidad and Tobago, Turkey, Tuvalu, Ukraine, United Kingdom of Great Britain and Northern Ireland, United States of America, Uruguay
Calculate Russian support by population instead of number of countries.
Steps
[ x ] Get each country population [ ] Get each country support of russia [ ] Calculate support of Russia by percentage