newspaper3k库非常棒。我对它上瘾了。
我想问一下,为什么大多数中国财经新闻页面的Source and build()只返回0篇文章?
我的代码中有什么问题吗?
from newspaper import Article, Source
url='https://wallstreetcn.com/live/global'
result=newspaper.Source(url,language='zh')
result.build()
result.size()
0发布于 2018-11-30 16:09:47
我运行你的代码,收到了不同的结果,也许你遇到了缓存问题。尝试添加memoize_articles=False,请参阅:
import newspaper
url='https://wallstreetcn.com/live/global'
result = newspaper.Source(url, language='zh', memoize_articles=False)
result.build()
result.size()
>>> 2您可以找到文档here
https://stackoverflow.com/questions/53502442
复制相似问题