Closed simonedu closed 8 years ago
Can you provide more details?
Like:
What Python version are you running?
Python 3.4.3
How did you install newspaper? (please provider output)
915 sudo yum install libxml2-dev libxslt-dev 916 sudo yum install libjpeg-dev zlib1g-dev libpng12-dev 917 sudo yum install libjpeg-dev 918 sudo yum install libjpeg 919 sudo yum install libjpeg 920 sudo yum install zlib1g 921 sudo yum install libpng12 922 sudo yum install libxml2 923 sudo yum install libxslt 926 sudo yum install zlib1g 927 sudo yum install zlib* 931 pip3 install newspaper3k 932 sudo pip3 install newspaper3k 933 curl https://raw.githubusercontent.com/codelucas/newspaper/master/download_corpora.py | python3
What is the code you're running and what's the output?
def text_extractor(url):
try:
article = Article(url)
article.download()
article.parse()
text = article.text
except:
text = ''
return text
Output: No text is extracted.
Can you remove the try/except to see if any exceptions are raised?
No exceptions. Same result: no text
That's weird... any specific urls it's failing on?
The same url has no problem on the other operating system (Ubuntu), hence it cannot be the url.
From: Yuri Prezument <notifications@github.com>
To: codelucas/newspaper newspaper@noreply.github.com Cc: simonedu simonedu@yahoo.com Sent: Thursday, March 10, 2016 4:19 PM Subject: Re: [newspaper] Running on Fedora (#225)
That's weird... any specific urls it's failing on?— Reply to this email directly or view it on GitHub.
Works for me on Fedora:
$ cat /etc/fedora-release
Fedora release 23 (Twenty Three)
$ python
Python 3.4.3 (default, Jun 29 2015, 12:15:26)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
>>> import newspaper
>>> article = newspaper.Article(url='https://www.opera.com/blogs/desktop/2016/03/native-ad-blocking-feature-opera-for-computers/')
>>> article.download()
>>> article.parse()
>>> article.text
'If there were no bloated ads, some top websites would load up to 90% faster.\n\nToday, w...'
This can be anything... installation issue, parsing issue on a specific url, maybe you used an earlier version of newspaper or a dependency when you installed on Ubuntu, etc...
Thank you very much.
@simonedu did you get it to work?
Yes, your program worked perfectly. Thank you.
Great!
We have a program in Python 3 using your package that runs well in Ubuntu, but when we try to run it in Fedora, it returns nothing. I followed the installation guide to the letter and the toolkit installed completely.
What do you suggest we do to solve this problem.
Thank you!