Pytho-goose项目是用Pytho重写的Goose,Goose原来是用Java写的文章提取工具。Pytho-goose的目标是给定任意资讯文章或者任意文章类的网页,不仅提取出文章的主体,同时提取出所有元信息以及图片等信息,支持中文网页。Pytho-goose可提取的信息包括:
文章主体内容
文章主要图片
文章中嵌入的任何Youtube/Vimeo视频
元描述
元标签
示例>>> from goose import Goose>>> url = 'https://editio.c.com/2012/02/22/world/europe/uk-occupy-lodo/idex.html?hpt=ieu_c2'>>> g = Goose()>>> article = g.extract(url=url)>>> article.titleu'Occupy Lodo loses evictio fight'>>> article.meta_descriptio"Occupy Lodo protesters who have bee camped outside the ladmark St. Paul's Cathedral for the past four moths lost their court bid to avoid evictio Wedesday i a decisio made by Lodo's Court of Appeal.">>> article.cleaed_text[:150](CNN) -- Occupy Lodo protesters who have bee camped outside the ladmark St. Paul's Cathedral for the past four moths lost their court bid to avoi>>> article.top_image.srchttps://i2.cd.turer.com/c/dam/assets/111017024308-occupy-lodo-st-paul-s-cathedral-story-top.jpg






评论