Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Selenium服务器无法创建与HTMLUnit的会话_Python_Htmlunit - Fatal编程技术网

Python Selenium服务器无法创建与HTMLUnit的会话

Python Selenium服务器无法创建与HTMLUnit的会话,python,htmlunit,Python,Htmlunit,我已经启动了一个本地selenium服务器,并让它与Chrome一起工作,但由于某些原因,我无法让它与HTMLUnit一起工作(我需要它,因为Chrome对于我打算运行的负载来说太重了) 我像这样启动selenium服务器: java -jar selenium-server-standalone-3.141.59.jar 但我也尝试过这个(因为我不确定对htmlunit驱动程序的依赖应该如何工作)。无论哪种方式,两者都给出相同的结果: java -cp selenium-server-sta

我已经启动了一个本地selenium服务器,并让它与Chrome一起工作,但由于某些原因,我无法让它与HTMLUnit一起工作(我需要它,因为Chrome对于我打算运行的负载来说太重了)

我像这样启动selenium服务器:

java -jar selenium-server-standalone-3.141.59.jar
但我也尝试过这个(因为我不确定对htmlunit驱动程序的依赖应该如何工作)。无论哪种方式,两者都给出相同的结果:

java -cp selenium-server-standalone-3.141.59.jar:htmlunit-driver-2.33.3-jar-with-dependencies.jar org.openqa.grid.selenium.GridLauncherV3
我使用python绑定:

self.driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.HTMLUNITWITHJS)
我得到的错误是:

selenium.common.exceptions.SessionNotCreatedException: Message: Unable to create session from {
  "desiredCapabilities": {
    "browserName": "htmlunit",
    "javascriptEnabled": true,
    "version": "firefox",
    "platform": "ANY"
  },
  "capabilities": {
    "firstMatch": [
      {
        "browserName": "htmlunit"
      },
      {
        "browserName": "htmlunit",
        "browserVersion": "firefox",
        "platformName": "any"
      }
    ]
  }
}
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '...', ip: 'fe80:0:0:0:1ce9:33:4280:d3bd%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '11.0.1'
Driver info: driver.version: unknown
Stacktrace:
    at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$4 (NewSessionPipeline.java:76)
    at java.util.Optional.orElseThrow (Optional.java:408)
    at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$5 (NewSessionPipeline.java:75)
    at java.util.Optional.orElseGet (Optional.java:369)
    at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession (NewSessionPipeline.java:73)
    at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute (BeginSession.java:65)
    at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0 (WebDriverServlet.java:235)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

我是如此接近。。。我所要做的就是颠倒类路径顺序

java -cp htmlunit-driver-2.33.3-jar-with-dependencies.jar:selenium-server-standalone-3.141.59.jar org.openqa.grid.selenium.GridLauncherV3

如何在windows上本地配置它?