Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import java.io.IOException;
- import java.io.PrintStream;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Document;
- import org.jsoup.nodes.Element;
- import org.jsoup.select.Elements;
- public class Scraper {
- public static void main(String[] args) {
- try {
- // fetch the document over HTTP
- Document doc = Jsoup.connect("http://www.brawlhalla.com/rankings/1v1/1/").get();
- // get the page title
- String title = doc.title();
- System.out.println("title: " + title);
- PrintStream fileStream = new PrintStream("data.txt");
- System.setOut(fileStream);
- //get all td div
- Elements links = doc.select("td[class]");
- for (Element link : links) {
- System.out.println(" " + link.text());
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement