简体   繁体   English

com.gargoylesoftware.htmlunit.ScriptException:错误:Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本

[英]com.gargoylesoftware.htmlunit.ScriptException: Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher

I am trying to browse http://taxtest.navajocountyaz.gov/Pages/WebForm1.aspx?p=1&apn=10301003B using Java code and the latest release of HTMLUnit (version 2.37.0, which I downloaded from a jar download website along with all its dependencies).我想浏览http://taxtest.navajocountyaz.gov/Pages/WebForm1.aspx?p=1&apn=10301003B使用Java代码和的HtmlUnit(版本2.37.0,最新发布的这是我从一个jar下载网站下载了一起及其所有依赖项)。

final WebClient webClient = new WebClient();
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.setRefreshHandler(new RefreshHandler() {
    public void handleRefresh(Page page, URL url, int arg) throws IOException {
        System.out.println("handleRefresh");
    }
});
HtmlPage page = (HtmlPage) webClient.getPage("http://taxtest.navajocountyaz.gov/Pages/WebForm1.aspx?p=1&apn=10301003B");

The last line of code throws the following exception: com.gargoylesoftware.htmlunit.ScriptException: Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher ( http://taxtest.navajocountyaz.gov/js/bootstrap.js#15 )最后一行代码抛出以下异常:com.gargoylesoftware.htmlunit.ScriptException: Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or later ( http://taxtest.navajocountyaz.gov/js/bootstrap.js#15 )

How do I fix my Java code to be able to browse http://taxtest.navajocountyaz.gov/Pages/WebForm1.aspx?p=1&apn=10301003B ?如何修复我的 Java 代码以便能够浏览http://taxtest.navajocountyaz.gov/Pages/WebForm1.aspx?p=1&apn=10301003B I am only interested in extracting some numerical values from the web page.我只对从网页中提取一些数值感兴趣。

I have posted this as an HTMLUnit issue at https://github.com/HtmlUnit/htmlunit/issues/127 , and RBRI has found a fix for it.我已将此作为 HTMLUnit 问题发布在https://github.com/HtmlUnit/htmlunit/issues/127 上,RBRI 已找到解决方法。 I am posting the fix below:我在下面发布了修复程序:

Adding the following import statement:添加以下导入语句:

    import com.gargoylesoftware.htmlunit.javascript.*;

and adding the following code并添加以下代码

    webClient.setJavaScriptErrorListener(new SilentJavaScriptErrorListener());

did fix the problem.确实解决了问题。

Thank you very much RBRI for your help.非常感谢 RBRI 的帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 bootstrap.js:未捕获的错误:Bootstrap的JavaScript需要jQuery 1.9.1或更高版本,但低于版本3 - bootstrap.js: Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3 Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本 - Bootstrap's JavaScript requires jQuery version 1.9.1 or higher com.gargoylesoftware.htmlunit.ScriptException:TypeError:无法调用null的方法“ appendChild” - com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method “appendChild” of null Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本,但低于版本 3 - Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3 失败 1 - com.gargoylesoftware.htmlunit.ScriptException:缺失; before 语句(文件中的脚本:discountprice.html 从 (90, 17) 到 (125, 18)#108) - Fail 1 - com.gargoylesoftware.htmlunit.ScriptException: missing ; before statement (script in file:discountprice.html from (90, 17) to (125, 18)#108) 未捕获的错误:Bootstrap的JavaScript需要jQuery 1.12.4或更高版本,但日期时间选择器低于jQuery 3。 - Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.12.4 or higher, but lower than version 3 in date time picker 错误:Bootstrap的JavaScript需要jQuery - Error: Bootstrap's JavaScript requires jQuery 间歇性的“Bootstrap的JavaScript需要jQuery”错误 - Intermittent “Bootstrap's JavaScript requires jQuery” error 未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery - Uncaught Error: Bootstrap's JavaScript requires jQuery Bootstrap错误消息错误:Bootstrap的JavaScript需要jQuery - Bootstrap error message Error: Bootstrap's JavaScript requires jQuery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM