codelucas / newspaper

newspaper3k is a news, full-text, and article metadata extraction in Python 3. Advanced docs:
https://goo.gl/VX41yK
MIT License
14.08k stars 2.12k forks source link

Print cannot be passed via php exec #412

Open aufche opened 7 years ago

aufche commented 7 years ago

Hello, dev

Maybe its a bug.

The code import newspaper

from newspaper import Article

berita = Article(url="http://opensourceforu.com/2016/07/22843/") berita.download() berita.parse()

print(berita.text.encode('utf-8'))

and i have php script to get returned string from python script

exec('python3 /var/www/ig.zavirajewelry.com/htdocs/pyton/berita.py', $output); print_r($output);

Its not working, but when i am remove import newspaper

print can passed to php script.

thanks

I am use ubuntu 14.04 & python 3.x

yprez commented 7 years ago

Does it work when you run the python script (python3 /var/www/ig.zavirajewelry.com/htdocs/pyton/berita.py) in the shell?