Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. package imdb.test;
  2.  
  3. import java.io.IOException;
  4. import java.io.PrintStream;
  5. import org.jsoup.nodes.Element;
  6. import org.jsoup.select.Elements;
  7.  
  8. import org.jsoup.Jsoup;
  9.  
  10.  
  11. public class test_1 {
  12.  
  13. private static final String Elements = null;
  14.  
  15. public static void main(String[] args) throws IOException{
  16.  
  17. PrintStream fileStream = new PrintStream("data.txt");
  18. System.setOut(fileStream);
  19.  
  20. String url = "http://www.brawlhalla.com/rankings/1v1/5555/";
  21. //first page
  22. Elements link = Jsoup.connect(url).get().select("td[class].pcenter");
  23. //an int just to count up pages
  24. int i = 1;
  25. System.out.println("ratatatat"+ i + "\t" + link.text());
  26. //parse next page using link
  27. //check if the div on next page has more than one td in it
  28. while(Jsoup.connect(Elements).get().select("td[class]").size() >1000){
  29.  
  30. link = Jsoup.connect(Elements).get().select("td[class].pcenter");
  31. System.out.println("pfffff"+ (++i) +"\t" + link.text());
  32.  
  33. }
  34.  
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement