Golang 文章正文抽取(readability)

Golang 文章正文抽取(readability),第1张

概述readability for golang Golang版本是根据readabiliity for node.js以及readability for python所改写,并加入了些自己的,比如支持gzip等。 引用的第三方包 github.com/PuerkitoBio/goquery github.com/axgle/mahonia 使用方法 package mainimport ( "

readability for golang

Golang版本是根据readabiliity for node.js以及readability for python所改写,并加入了些自己的,比如支持gzip等。

引用的第三方包

github.com/PuerkitoBio/goquery
github.com/axgle/mahonia

使用方法
package mainimport (	"fmt"	"github.com/ying32/readability")func main() {    test,err := readability.NewReadability("http://wd.leiting.com/home/news/news_detail.PHP?ID=599")    if err != nil {	fmt.Println("Failed.",err)	return    }    test.Parse()    fmt.Println(test.Title)    fmt.Println(test.Content)}
源代码

github.com/ying32/readability

总结

以上是内存溢出为你收集整理的Golang 文章正文抽取(readability)全部内容,希望文章能够帮你解决Golang 文章正文抽取(readability)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1273224.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存