Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package imdb.test;
- import java.io.IOException;
- import java.io.PrintStream;
- import org.jsoup.nodes.Element;
- import org.jsoup.select.Elements;
- import org.jsoup.Jsoup;
- public class test_1 {
- private static final String Elements = null;
- public static void main(String[] args) throws IOException{
- PrintStream fileStream = new PrintStream("data.txt");
- System.setOut(fileStream);
- String url = "http://www.brawlhalla.com/rankings/1v1/5555/";
- //first page
- Elements link = Jsoup.connect(url).get().select("td[class].pcenter");
- //an int just to count up pages
- int i = 1;
- System.out.println("ratatatat"+ i + "\t" + link.text());
- //parse next page using link
- //check if the div on next page has more than one td in it
- while(Jsoup.connect(Elements).get().select("td[class]").size() >1000){
- link = Jsoup.connect(Elements).get().select("td[class].pcenter");
- System.out.println("pfffff"+ (++i) +"\t" + link.text());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement