从python脚本检索结果时遇到问题
我的php脚本如下:
<?php
$cmd=escapeshellcmd('/opt/lampp/htdocs/adpNews/adpScripts/getArticle.py');
$result=shell_exec("python $cmd");
echo $result;
?>
我的Python脚本如下:
#!/usr/bin/env python
from newspaper import Article
url=u'http://www.abplive.in/india-news/countering-terrorism-an-important-shared-objective-by-india-united-states-manohar-parrikar-407134'
article=Article(url)
article.download()
article.parse()
print article.text
请给我解决方案