Handle multi-lingual article extraction
masterNewspaper supports automatic language detection, but you can explicitly specify a language using the language parameter in the Article constructor or the newspaper.build() function. This is useful for ensuring accurate NLP and parsing for specific languages.
from newspaper import Article
# Explicitly set language to Chinese
url = 'http://www.bbc.co.uk/zhongwen/simp/chinese_news/2012/12/121210_hongkong_politics.shtml'
a = Article(url, language='zh')
a.download()
a.parse()
print(a.title)
# Or when building from a source
import newspaper
sina_paper = newspaper.build('http://www.sina.com.cn/', language='zh')