Reputation: 59
The newspaper3k library is amazing. I am addicted on it.
May I ask, why the Source and build() only return 0 articles from most of the china financial news page?
Any problem in my code?
from newspaper import Article, Source
url='https://wallstreetcn.com/live/global'
result=newspaper.Source(url,language='zh')
result.build()
result.size()
0
Upvotes: 2
Views: 631
Reputation: 2535
I run your code and received a different result, maybe you run into cache problem. try to add memoize_articles=False
, see:
import newspaper
url='https://wallstreetcn.com/live/global'
result = newspaper.Source(url, language='zh', memoize_articles=False)
result.build()
result.size()
>>> 2
you can find the documentation here
Upvotes: 1