Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.io.IOException;
  2.  
  3. import org.jsoup.Jsoup;
  4. import org.jsoup.nodes.Document;
  5. import org.jsoup.nodes.Element;
  6. import org.jsoup.select.Elements;
  7.  
  8. public class Init {
  9.  
  10.     public static void main(String[] args) {
  11.  
  12.         Document doc;
  13.         try {
  14.  
  15.             // need http protocol
  16.             doc = Jsoup.connect("http://stpp.sumy.ua/index.php?do=zamena").get();
  17.  
  18.             // get page title
  19.             String title = doc.title();
  20.             System.out.println("title : " + title);
  21.  
  22.             // get all links
  23.             Elements pre = doc.select("pre");
  24.  
  25.             System.out.println(pre.toString());
  26.  
  27.         } catch (IOException e) {
  28.             e.printStackTrace();
  29.         }
  30.  
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement