Golang article body extract (readability)

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Readability for Golang

The Golang version was rewritten according to readabiliity for node. js and readability for Python, and added some of its own, such as support for Gzip.

Referenced third-party packages

Github.com/puerkitobio/goquery
Github.com/axgle/mahonia

How to use

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)}

Source

Github.com/ying32/readability

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.