2

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
Marcus AU
  • 39
  • 2

1 Answers1

1

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

Ami Hollander
  • 2,435
  • 3
  • 29
  • 47