Created
May 30, 2017 20:42
-
-
Save nyannko/8abb063ab9f794e11711e4e69e478859 to your computer and use it in GitHub Desktop.
Grab top 50 anime in myanimelist
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
import java.io.IOException; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
public class scraper { | |
public static void main(String[] args) throws IOException { | |
Document doc = Jsoup.connect("https://myanimelist.net/topanime.php").get(); | |
for(Element row: doc.select(".ranking-list")) { | |
String title = row.select(".title").text(); | |
String rating = row.select(".js-top-ranking-score-col").text(); | |
System.out.println(title+"\n"+rating); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment