Selenium with GhostDriver in Python on Windows

前端 未结 3 1556
北海茫月
北海茫月 2021-01-02 04:07

This is embarrassing to ask because it seems like something with so slim chance of error. I wouldn\'t think this would be difficult, but I\'ve been plugging away at this for

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 04:23

    I had the same problem running Python 3.4 on Windows Server 2012 R2. PhantomJS was failing to create the ghostdriver.log file. I followed these steps that fixed it for me:

    • Made sure phantomjs.exe was not showing "Blocked" on the File Properties|Security tab, and ran it as standalone app to confirm.
    • Deleted an old copy of the ghostdriver.log file that was in the same directory.
    • Ran python REPL from the console while checking to see if the code that instantiated the driver was getting called successfully.

      browser = webdriver.PhantomJS(executable_path='phantomjs.exe', desired_capabilities=argdc, service_args=svc_args)
      

提交回复
热议问题