The last main method is responsible for calling
import java.util.ArrayList; public class Main { public static void main(String[] args) { // 定义即将访问的链接 String url = "http://www.zhihu.com/explore/recommendations"; // 访问链接并获取页面内容 String content = Spider.SendGet(url); // 获取该页面的所有的知乎对象 ArrayList<Zhihu> myZhihu = Spider.GetZhihu(content); // 打印结果 System.out.println(myZhihu); } }
Ok This is done. Run it and see the results:
Good results.
The next step is to access the link and get all the answers.
We will introduce it next time.
Okay, the above is a brief introduction to the entire process of how to use java to capture content recommended by Zhihu editors. It is very detailed and easy to understand. Friends who need it can refer to it. , there is no problem in free expansion
The above is the content of writing Java Zhihu crawler with zero foundation to obtain Zhihu editor recommended content (4). For more related content, please pay attention to the PHP Chinese website (www.php.cn )!