然后我就用Jsoup把想要的爬下来了。
最后代码就生成到项目下的MyJsoup.txt下了。
Document doc = Jsoup.connect("http://www.360doc.com/content/13/1210/01/1956846_335862874.shtml")
.data("query","Java").userAgent("Mozilla").cookie("auth", "token").timeout(3000).get();
Element ele= doc.getElementById("p");
String text = doc.body().text();
File file = new File("MyJsoup.txt");
if(file.exists()){
file.createNewFile();
}
FileWriter fw = new FileWriter(file.getName());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(text);
bw.close();
System.out.println("Done");