htmlunitを使用してウェブサイトをクロールしようとしています。それだけで次のエラーを出力しても、私はそれを実行するたびに:htmlunit未定義からプッシュを読み取ることができません
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "push" from undefined (https://www.kinoheld.de/dist/prod/0.4.7/widget.js#1)
今私は、JSについてあまり知らないが、私はpush
は、アレイ動作のいくつかの種類であることを読みました。これは私にとって標準的だと私はなぜhtmlunitでサポートされないのか分からない。ここで
public static void main(String[] args) throws IOException {
WebClient web = new WebClient(BrowserVersion.FIREFOX_45);
web.getOptions().setUseInsecureSSL(true);
String url = "https://www.kinoheld.de/kino-muenchen/royal-filmpalast/vorstellung/280823/?mode=widget&showID=280828#panel-seats";
web.getOptions().setThrowExceptionOnFailingStatusCode(false);
web.waitForBackgroundJavaScript(9000);
HtmlPage response = web.getPage(url);
System.out.println(response.getTitleText());
}
私は何をしないのですか?これを回避する方法やこれを解決する方法はありますか? ありがとうございます!
サポートされていない場合は、開発者に新しい機能をリクエストする必要があります。 –
エラーはいつ発生しますか? 'web.getPage(url)'や 'response.getTitleText()'コールの後に? – Jack
@Jack 'web.getPage(url)'の後にエラーが発生します。 'web.getOptions()。setThrowExceptionOnScriptError(false)が返されたときでも、' response.getTitleText() ); '(下記の回答を参照)が挿入されています。 – Maverick283