在用Python启动的脚本中运行phantomjs/casperjs native选项

在用Python启动的脚本中运行phantomjs/casperjs native选项,python,bash,web-scraping,phantomjs,casperjs,Python,Bash,Web Scraping,Phantomjs,Casperjs,CasperJS版本1.1.0-beta3,在OSX 10.10.4 64位上使用phantomjs版本1.9.8和Python 2.7.6 您好,谢谢您的来访:) 我正在运行一个JS脚本,使用casperjs,它需要用Python脚本启动 从bash启动JS脚本时,需要CLI--ignore ssl errors=true才能成功运行 在bash中启动Python脚本时,不可能使用--ignore ssl errors=true,因为它是phantomjs/casperjs本机选项。为了解决这

CasperJS版本1.1.0-beta3,在OSX 10.10.4 64位上使用phantomjs版本1.9.8和Python 2.7.6

您好,谢谢您的来访:)

我正在运行一个JS脚本,使用casperjs,它需要用Python脚本启动

从bash启动JS脚本时,需要CLI
--ignore ssl errors=true
才能成功运行

在bash中启动Python脚本时,不可能使用
--ignore ssl errors=true
,因为它是phantomjs/casperjs本机选项。为了解决这个问题,我试着用编程的方式来做,因为根据我的评论,这似乎是可能的

阅读后,我在JS脚本中使用了以下语法组合:

ignoreSslErrors : true;

ignoreSslErrors = true;

ignoreSslErrorsEnabled : true;

ignoreSslErrorsEnabled = true;
在启动JS脚本时,没有一个可以工作,因此当脚本 使用Python脚本启动。我的语法有什么遗漏吗

有没有办法通过Python脚本将本机命令发送到phantomjs/casperjs?具体来说,有没有一种方法可以通过Python脚本发送
——ignoresslerrors=true

如果你需要更多的细节,请告诉我

感谢您花时间阅读:)

>在bash中启动Python脚本时,无法使用--ignore ssl errors=true

事实上,这是很有可能的。这样做很好:

import subprocess
args = ['/usr/local/bin/casperjs', '--ignore-ssl-errors=true', '/path/to/script.js']
subprocess.call(args) 

那很有魅力!谢谢:)我必须升级我的Python游戏:D