-1

好的,我知道 Facebook 不允许我们检索朋友的电子邮件和电话号码等信息,但我正试图通过报废来获得它。唯一的问题是我总是最终获得登录页面的 html 数据,而不是用户信息页面本身。即使我的 webview 显示信息页面,我仍然无法获取该页面的 html 数据。任何排序帮助将不胜感激。我的代码是

StringBuffer myString = new StringBuffer();
             try {
                 String thisLine;
                 URL u = new URL(myWebView.getUrl());//url is http://m.facebook.com/username?v=info
                 DataInputStream theHTML = new DataInputStream(u.openStream());
                 while ((thisLine = theHTML.readLine()) != null) {
                     myString.append(thisLine);
                 } 
             } catch (MalformedURLException e) {
              e.printStackTrace();
             } catch (IOException e) {
              e.printStackTrace();
             }
4

1 回答 1

1

这行不通。正如您每次使用不同的浏览器都需要登录一样,您也需要使用 Java HTTP 提取器登录。

于 2012-02-08T11:05:56.483 回答