import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.sql.*;
public class linksfind{
public static void main(){
String html = "http://www.apple.com/pr/";
Document document = Jsoup.parse(html); // Can also take an URL.
for (Element element : document.getElementsByTag("a")) {
System.out.println(element.attr("href"));
}
}
}
伙计们,在上面的程序中,在执行时我发现了这些错误。如何解决?我已经在我的文件夹位置下载了 Jsoup.jar 文件。我还应该做什么?
linksfind.java:8: cannot find symbol
symbol : class Document
location: class linksfind
Document document = Jsoup.parse(html); // Can also take a
^
linksfind.java:8: cannot find symbol
symbol : variable Jsoup
location: class linksfind
Document document = Jsoup.parse(html); // Can also take a
^
linksfind.java:9: cannot find symbol
symbol : class Element
location: class linksfind
for (Element element : document.getElementsByTag("a")) {