Why the python module newspaper3k only return 0 articles for tencent, sina and wallstreetcn?

601 Views Asked by At

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
1

There are 1 best solutions below

0
On

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