好的,我知道 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();
}