GithubHelp home page GithubHelp logo

importviewspider's Introduction

使用Jsoup爬取Importnew的文章

写在前面

1. 本次爬取的是importnew网站上的文章,因为感觉写得很好!
2. 本次采用jsoup的开源框架官方教程:[link](http://www.open-open.com/jsoup).
3. 此方式和之前的不同,前面头条是通过api接口获取json,jsoup则是采用dom解析方式。
4. 而且jsoup选择器使用方法都和jQuery类似。

实现思路

1. 获取importnew的文章链接[link]http://www.importnew.com/all-posts/page/x.
2. 上面的x就是分页码,一共有131页,4000多篇文章。
3. 首先获取列表下的文章的题目和url储存到数据库。
4. 然后过滤自己想要的文章类型和方向下载。
5. 使用jsoup获取url下的具体文章,使用jsoup选择器把有用内容选择到。
6. 在把获取到的文章内容写到本地磁盘以md格式,这样就不用提取内容中的文字,md格式直接打开效果比HTML好。

使用

main包下面就是。

importviewspider's People

Contributors

saanl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.