search

Home  >  Q&A  >  body text

python - 使用webdriver.PhantomJS()出错


请问各位大神,这是什么情况???

巴扎黑巴扎黑2887 days ago320

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 17:35:38

    Restart the computer and try.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:35:38

    详见http://stackoverflow.com/questions/36153...
    Solved by changing function in selenium.webdriver.phantomjs.service.py like follow:

    was

    def send_remote_shutdown_command(self):
        if self._cookie_temp_file:
                os.remove(self._cookie_temp_file)
    

    after adding try/except construction:

    def send_remote_shutdown_command(self):
        try:
            if self._cookie_temp_file:
                os.remove(self._cookie_temp_file)
        except PermissionError:
            pass

    reply
    0
  • Cancelreply