Home  >  Article  >  Java  >  Write Java Zhihu crawler with zero foundation to crawl Zhihu answers (3)

Write Java Zhihu crawler with zero foundation to crawl Zhihu answers (3)

黄舟
黄舟Original
2016-12-24 11:45:261089browse

Main.java

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.GetRecommendations(content);
  // 打印结果
  System.out.println(myZhihu);
 }
}


The above are all the records of grabbing Zhihu answers. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn