2017-11-30 16 views
0
Traceback (most recent call last): File "tb_list_spider.py", line 42, in parse_tblist 
    driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 52, in __init__ 
    self.service.start() File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 96, in start 
    self.assert_process_still_running() File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 109, in assert_process_still_running 
    % (self.path, return_code) selenium.common.exceptions.WebDriverException: Message: Service phantomjs unexpectedly exited. Status code was: -11 

Message: Service phantomjs unexpectedly exited. Status code was: -11 


desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = user_agent 
driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities) # thie line encountered exception 

위는 역 추적 정보입니다 잡고 있습니다. 커맨드 라인 방식으로 코드를 실행하면 좋지만 브라우저 http 요청을 사용하여 phantomJS를 uWSGI 인터페이스로 트리거하면 작동하지 않습니다.PhantomJS는 웹 데이터

오류 코드는 -11이지만, 어디에서 -11 메가닝을 찾을 수 있는지 알지 못합니다. 누가 오류 코드 의미를 알고 제발 말해 줘서 고마워.

환경 : centos7가 + python3.6.2 + phantomJS-2.1.1 + uWSGI-2.0.15 + 장고-1.11.7 + 셀레늄-3.7.0

답변

0

나는 이미 ansows 이유를 알고,이 때문에 우 쉬기의 환경. 한계가 원인이므로 주석 처리하면 정상으로 복구됩니다.

[uwsgi] 
#vhost = false 
http = :80 
#master = true   //主进程 
#vhost = true   //多站模式 
#no-site = true  //多站模式时不设置入口模块和文件 
workers = 10   //子进程数 
#reload-mercy = 10 
#vacuum = true   //退出、重启时清理文件 
#max-requests = 1000 
#limit-as = 512  //这个设置uwsgi内存大小的,无法启动phantomjs就是这个导致的 
buffer-size = 30000 
wsgi-file = /grab_web/web_api/web_api/wsgi.py 
chdir = /grab_web/web_api/web_api 
enable-threads = true 
#single-interpreter = true