私は初めてでSelenium
、サイトに接続しようとしています。
String url = [url][1]
WebDriver driver = new HtmlUnitDriver(true);
driver.get(url);
この行の実行中に JavaScript エラーが発生します。
私はいくつかの質問を検索し、また試しました
driver.setJavascriptEnabled(true);
それでも、同じ問題が発生してdrive.get(url)
います。
ここで実際の問題を見つけることができません。
この背後にある主な問題は何ですか?読み込みに少し時間がかかるページですか?それとも他の理由?
問題の出力テキストも貼り付けました。この下で
Nov 23, 2015 5:03:15 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'application/x-javascript'.
Nov 23, 2015 5:03:17 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'application/x-javascript'.
Nov 23, 2015 5:03:21 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'application/x-javascript'.
Exception in thread "main" org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException:
TypeError: TypeError: redeclaration of const constructor.
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
System info: host: 'User-PC', ip: '192.168.1.66', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.
version: '1.8.0_40'
Driver info: driver.version: HtmlUnitDriver
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:554)