Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not fetch arabic news #91

Closed
ghost opened this issue Jan 16, 2021 · 1 comment
Closed

Does not fetch arabic news #91

ghost opened this issue Jan 16, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 16, 2021

Hello,
I tried it but it did not fetch Arabic news such as https://www.alarabiya.net/
I got zero articles.

My code:

news_paper = newspaper3k.build('https://www.alarabiya.net/', language='ar', memoize_articles=False) 
for article in news_paper.articles:
    article_url = article.url
    news = newsfetch(article_url)

Any idea?

@santhoshse7en
Copy link
Owner

Refer Link - https://github.com/codelucas/newspaper/
If you are certain that an entire news source is in one language, go ahead and use the same api :)

>>> import newspaper
>>> sina_paper = newspaper.build('http://www.sina.com.cn/', language='zh')

>>> for category in sina_paper.category_urls():
>>>     print(category)
http://health.sina.com.cn
http://eladies.sina.com.cn
http://english.sina.com
...

>>> article = sina_paper.articles[0]
>>> article.download()
>>> article.parse()

>>> print(article.text)
新浪武汉汽车综合 随着汽车市场的日趋成熟传统的集全家之力抱得爱车归的全额购车模式已然过时另一种轻松的新兴 车模式――金融购车正逐步成为时下消费者购
买爱车最为时尚的消费理念他们认为这种新颖的购车
模式既能在短期内
...

>>> print(article.title)
两年双免0手续0利率 科鲁兹掀背金融轻松购_武汉车市_武汉汽
车网_新浪汽车_新浪网

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant