Home > Java > javaTutorial > body text

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

黄舟
Release: 2016-12-24 11:45:26
Original
1063 people have browsed it

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);
 }
}
Copy after login


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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!