首页 > 解决方案 > htmlunit 无法处理 javascript 模块

问题描述

当使用 HTMLUnit 解析复杂的网页时,启用了 javascript,它拒绝处理 type="module" 脚本。

查看 HTMLUnit HtmlScript 的源代码,它看起来像“text/javascript”以外的任何类型的脚本 || « text/ecmascript » 或 « application/javascript" || « application/ecmascript" || “应用程序/x-javascript”被拒绝

错误是: com.gargoylesoftware.htmlunit.html.HtmlScript isExecutionNeeded 警告:脚本不是 JavaScript(类型:模块,语言:)。跳过执行。

有没有办法让模块脚本也执行?

谢谢

标签: javascriptjavahtmlunitrhino

解决方案


推荐阅读