Eclipse 使用WebDriver时无法创建HTML解析器

Eclipse 使用WebDriver时无法创建HTML解析器,eclipse,macos,selenium,webdriver,Eclipse,Macos,Selenium,Webdriver,遵循此WebDriver教程: 在osx、eclipse、selenium 2.33上,我得到: Exception in thread "main" org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser Build info: version: '2.33.0', revision: '4e9

遵循此WebDriver教程: 在osx、eclipse、selenium 2.33上,我得到:

Exception in thread "main" org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:32:38'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.8.3', java.version: '1.6.0_51'
Driver info: driver.version: HtmlUnitDriver
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:376)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:344)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:178)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:188)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:184)
    at com.dexter.test.exactor.command.GoogleWDCommand.execute(GoogleWDCommand.java:21)
    at com.dexter.test.exactor.command.GoogleWDCommand.main(GoogleWDCommand.java:13)
Caused by: com.gargoylesoftware.htmlunit.ObjectInstantiationException: unable to create HTML parser
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.<init>(HTMLParser.java:454)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.<init>(HTMLParser.java:378)
    at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:212)
    at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:187)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:434)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:309)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:374)
    at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:366)
    ... 6 more
Caused by: org.xml.sax.SAXNotRecognizedException: Feature 'http://cyberneko.org/html/features/parse-noscript-content' is not recognized.
    at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
    at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.<init>(HTMLParser.java:446)
    ... 15 more

你知道这是为什么吗?

我更愿意添加一条评论,但我还没有足够的声誉。 我在许多其他论坛上注意到,这个问题可能与您的nekohtml依赖版本有关。你已经查过了吗


我甚至不知道你是否已经修复了它,因为这篇文章已经快一年了。

你要导航到哪里?当你导航到时它能工作吗?所以在上面的URL中删除了我的http://。确保您的url中有webdriver导航到的地址。您是否添加了下载的selenium的所有JAR?您必须添加libs文件夹内外的所有jar。@cegprakash添加了所有jar。没用。相同错误错误错误说明无法创建HTML解析器。你能提供你试图访问的网页的url或来源吗?看看这个