0
我需要下載一個特定的Facebook頁面的源代碼。 所以我想我會登錄到Facebook,然後下載源代碼。 但是關於我的信息記錄在被簡單地丟失,當我嘗試下載源代碼ROM看來我還是登出我的應用程序的另一個網址。下載Facebook頁面源代碼
因此,這裏是我的代碼:
public class App
{
public static void main(String[] args) throws IOException
{
System.out.println("Hello World!");
final WebClient webClient = new WebClient();
final HtmlPage page1 = webClient.getPage("http://www.facebook.com");
final HtmlForm form = (HtmlForm) page1.getElementById("login_form");
final HtmlSubmitInput button = (HtmlSubmitInput) form.getInputsByValue("Log In").get(0);
final HtmlTextInput textField = form.getInputByName("email");
textField.setValueAttribute("email");
final HtmlPasswordInput textField2 = form.getInputByName("pass");
textField2.setValueAttribute("password");
final HtmlPage page2 = button.click();
HtmlPage weread = webClient.getPage("http://apps.facebook.com/ireadit/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=2_0");
System.out.println(weread.asXml());
}
我希望你明白我的idea..any建議,該怎麼辦呢?