public static void main(String[] args) throws IOException, InterruptedException
{
WebClient webClient = new WebClient();
WebRequest request = new WebRequest(new URL("https://groups.google.com/forum/?fromgroups#!forum/mobile-social-networking-nepal"));
HtmlPage page = webClient.getPage(request);
webClient.waitForBackgroundJavaScript(1000000);
System.out.println(page.asXml());
webClient.closeAllWindows();
}
上記のURLで指定されたGoogleグループページを運なしでスクレイピングするための上記のコードを作成しました。私が得るのは、空の div 要素と span 要素です。他の URL で試してみたところ正常に動作しましたが、Google グループ ページでは動作していないようです。さらに、望ましくない出力を得るには、非常に長い時間がかかります。助けが必要です。