Last active
December 3, 2023 07:27
-
-
Save rrguntaka/9c7e38f134400d457fccc86e231b3eec to your computer and use it in GitHub Desktop.
Scrape Live India Election results - MLA Elections
This file contains hidden or 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
//https://results.eci.gov.in/ | |
//https://results.eci.gov.in/AcResultGenDecNew2023/partywiseleadresult-742S29.htm | |
//Navigating to the candidate list, open developer tools window, adn paste the following snippet in Console | |
jQuery(".custom-table table tbody tr").map(function (params) { | |
return { | |
"Constituency": jQuery("td:nth-child(2)", this).text(), | |
"Name": jQuery("td:nth-child(3)", this).text(), | |
"Margin": Number(jQuery("td:nth-child(5)", this).text()) | |
} | |
}) | |
.get().sort(function(a, b) { return a.Margin - b.Margin }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment