fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. import org.jsoup.Jsoup;
  8. import org.jsoup.nodes.Document;
  9. import org.jsoup.parser.Parser;
  10. import org.jsoup.select.Elements;
  11.  
  12.  
  13. /* Name of the class has to be "Main" only if the class is public. */
  14. class Ideone
  15. {
  16. public static void main (String[] args) throws java.lang.Exception
  17. {
  18. // your code goes here
  19. String url = "http://w...content-available-to-author-only...u.com/";
  20. Document doc = Jsoup.connect(url).get();
  21. Elements links = doc.select("a[href]");
  22. for(Element link : links){
  23. String linkHref = link.attr("href");
  24. System.out.println(linkHref);
  25.  
  26. }
  27.  
  28. }
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:7: error: package org.jsoup does not exist
import org.jsoup.Jsoup;
                ^
Main.java:8: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Document;
                      ^
Main.java:9: error: package org.jsoup.parser does not exist
import org.jsoup.parser.Parser;
                       ^
Main.java:10: error: package org.jsoup.select does not exist
import org.jsoup.select.Elements;
                       ^
Main.java:20: error: cannot find symbol
		Document doc = Jsoup.connect(url).get();
		^
  symbol:   class Document
  location: class Ideone
Main.java:20: error: cannot find symbol
		Document doc = Jsoup.connect(url).get();
		               ^
  symbol:   variable Jsoup
  location: class Ideone
Main.java:21: error: cannot find symbol
		Elements links = doc.select("a[href]");
		^
  symbol:   class Elements
  location: class Ideone
Main.java:22: error: cannot find symbol
		for(Element link : links){
		    ^
  symbol:   class Element
  location: class Ideone
8 errors
stdout
Standard output is empty