Mercury Web Parser 開源
栏目: JavaScript · 发布时间: 6年前
内容简介:看到「這個版本是用先前其他的軟體與服務可以參考「
看到「 Mercury Goes Open Source! 」這篇, Postlight 的團隊開源了 Mercury Web Parser ,程式碼在 GitHub 上的 postlight/mercury-parser 可以取得。
這個版本是用 Node.js 寫的,可以從範例看出用法以及結果:
import Mercury from '@postlight/mercury-parser'; Mercury.parse(url).then(result => console.log(result););
{
"title": "Thunder (mascot)",
"content": "<div><div><p>This is the content of the page!</div></div>",
"author": "Wikipedia Contributors",
"date_published": "2016-09-16T20:56:00.000Z",
"lead_image_url": null,
"dek": null,
"next_page_url": null,
"url": "https://en.wikipedia.org/wiki/Thunder_(mascot)",
"domain": "en.wikipedia.org",
"excerpt": "Thunder Thunder is the stage name for the horse who is the official live animal mascot for the Denver Broncos",
"word_count": 4677,
"direction": "ltr",
"total_pages": 1,
"rendered_pages": 1
}
先前其他的軟體與服務可以參考「 Evaluating Text Extraction Algorithms 」這篇的整理與比較,不過這篇連原網站都不見了... 只能從 Internet Archive 上翻出來。
這個主題有不少團隊都做過 (給一個 html 網頁,抓出實際的內容塊落),但也死了不少團隊... 比較有印象的是 Readability ,在 2016 年收掉了:「 The Readability bookmarking service will shut down on September 30, 2016. 」。
要撈資料可以拿來用...
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
JavaScript设计模式与开发实践
曾探 / 人民邮电出版社 / 2015-5 / 59.00元
本书在尊重《设计模式》原意的同时,针对JavaScript语言特性全面介绍了更适合JavaScript程序员的了16个常用的设计模式,讲解了JavaScript面向对象和函数式编程方面的基础知识,介绍了面向对象的设计原则及其在设计模式中的体现,还分享了面向对象编程技巧和日常开发中的代码重构。本书将教会你如何把经典的设计模式应用到JavaScript语言中,编写出优美高效、结构化和可维护的代码。一起来看看 《JavaScript设计模式与开发实践》 这本书的介绍吧!
HTML 编码/解码
HTML 编码/解码
HSV CMYK 转换工具
HSV CMYK互换工具