我第一次尝试使用 HtmlUnit。在 Eclipse 中为 EE 工作。我的构建路径中有 jar 文件。该项目可以编译,但在运行时会出现运行时错误:
com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration loadConfiguration 严重:加载 JavascriptConfiguration.xml 时出错
java.lang.NullPointerException 在 com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.getConfigurationFileAsReader(JavaScriptConfiguration.java:256) 在 com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.loadConfiguration(JavaScriptConfiguration.java:180) 在 com. gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.(JavaScriptConfiguration.java:142) 在 com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.getInstance(JavaScriptConfiguration.java:237) 在 com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.( JavaScriptEngine.java:117) 在 com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:215) 在 com.gargoylesoftware.htmlunit.WebClient.(WebClient.java:189)
发现一些帖子说从哪里获取该文件以及将其放在哪里,但没有任何帮助。有人知道吗?谢谢