使用PhantomJSDriver.jar包,运行时报错

报错信息如下:
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: executable: G:\workspace\phantomjs-2.1.1-windows\bin\phantomjs.exe
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: port: 3127
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: arguments: [--webdriver=3127, --webdriver-logfile=G:\workspace\DLPCenter_latest\phantomjsdriver.log]
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: environment: {}
[INFO - 2019-03-14T11:46:05.188Z] GhostDriver - Main - running on port 3127
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/net/MediaType
at org.openqa.selenium.remote.http.JsonHttpCommandCodec.encode(JsonHttpCommandCodec.java:197)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.phantomjs.PhantomJSCommandExecutor.execute(PhantomJSCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:115)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:104)
at com.tipray.test.EchartsDemoTest.getPhantomJSDriver(EchartsDemoTest.java:102)
at com.tipray.test.EchartsDemoTest.saveSurfModelUrlToImg(EchartsDemoTest.java:53)
at com.tipray.test.EchartsDemoTest.main(EchartsDemoTest.java:48)
Caused by: java.lang.ClassNotFoundException: com.google.common.net.MediaType
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 12 more

仅导入
com.codeborne
phantomjsdriver
1.2.1

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问