node.js - 怎么用nodejs分析出爬的不同网页那部分是文章标题和内容主体,有相关资料吗
大家讲道理
大家讲道理 2017-04-17 11:30:04
0
3
634

怎么用nodejs分析出爬的不同网页那部分是文章标题和内容而不是页面的其他元素,有相关资料吗

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
PHPzhong

If it is a specific website, you can make some matches based on its pages.
It would be difficult to be compatible with all websites. Identification based solely on tag names is definitely not accurate. There should be algorithms such as neural networks and machine learning.

伊谢尔伦

It is more convenient to use the cheerio module.
Example: http://www.focalhot.com/blog/62.html

巴扎黑

Content themes can try using line block density
You can only find tags like h1-h3 for the title

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template