[英]Why the python module newspaper3k only return 0 articles for tencent, sina and wallstreetcn?
news3k图书馆很棒。 我上瘾了。
我想问一下,为什么Source和build()只从大多数中国金融新闻页面返回0篇文章?
我的代码有问题吗?
from newspaper import Article, Source
url='https://wallstreetcn.com/live/global'
result=newspaper.Source(url,language='zh')
result.build()
result.size()
0
我运行您的代码并收到了不同的结果,也许您遇到了缓存问题。 尝试添加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
您可以在这里找到文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.