Skip to content

Instantly share code, notes, and snippets.

@joriki
Created July 30, 2021 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joriki/5cc6354b5ff1b434e7d072e946c54080 to your computer and use it in GitHub Desktop.
Save joriki/5cc6354b5ff1b434e7d072e946c54080 to your computer and use it in GitHub Desktop.
package games.chess.fide;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
public class WorldRankingExtracter {
public static void main(String [] args) throws IOException {
int rank = 0;
for (Element player : Jsoup.connect("https://ratings.fide.com/top.phtml?list=men").get().select("a.tur")) {
String attr = player.attr("href");
System.out.println('|' + attr.substring(attr.indexOf('=') + 1) + "=" + ++rank);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment