爬取phantomjs +selenium
用phantomjs+selenium截图时,出现
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/browserlaunchers/Proxies at org.openqa.selenium.phantomjs.PhantomJSDriverService.createDefaultService(PhantomJSDriverService.java:178) at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:99) at mytest.PhantomjsTest.main(PhantomjsTest.java:37) Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.browserlaunchers.Proxies at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 moremaven配置有下列这些
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.39.0</version>//这里之前用的2.44版本,把版本改为2.39就没有这个问题了
</dependency>
本文固定链接:http://www.yizhi227.com/?post=74
本文由Jessie原创或编辑,互联分享,尊重版权,转载请以链接形式标明本文地址
本文由Jessie原创或编辑,互联分享,尊重版权,转载请以链接形式标明本文地址