【发布时间】:2013-10-23 20:58:07
【问题描述】:
我在我的代码中遇到了 IllegalMonitorStateException,我不确定为什么会收到它以及如何修复它。我当前的代码是并且错误发生在 try 块中:
public static String scrapeWebsite() throws IOException {
final WebClient webClient = new WebClient();
final HtmlPage page = webClient.getPage(s);
final HtmlForm form = page.getForms().get(0);
final HtmlSubmitInput button = form.getInputByValue(">");
final HtmlPage page2 = button.click();
try {
page2.wait(1);
}
catch(InterruptedException e)
{
System.out.println("error");
}
String originalHtml = page2.refresh().getWebResponse().getContentAsString();
return originalHtml;
}
}
【问题讨论】:
标签: java error-handling wait