Android jSoup帮助

| 我正在尝试使用jSoup从此URL http://skyalipi.blogspot.com/2011/04/there-is-no-resistance-without.html解析html。我正在使用此代码
Document doc = Jsoup.parse(\"http://skyalipi.blogspot.com/2011/04/there-is-no-resistance-without.html\");  

       Log.d(\"test\", \"the elements\"+doc);
在日志中,我得到以下内容
05-26 12:05:05.355: DEBUG/test(696): the elements<html>
05-26 12:05:05.355: DEBUG/test(696):  <head></head>
05-26 12:05:05.355: DEBUG/test(696):  <body>
05-26 12:05:05.355: DEBUG/test(696):   http://skyalipi.blogspot.com/2011/04/there-is-no-resistance-without.html 
05-26 12:05:05.355: DEBUG/test(696):  </body>
05-26 12:05:05.355: DEBUG/test(696): </html>
我想获取段落内容。我不知道我要去哪里错了。我也参考了以下网址http://jsoup.org/cookbook/extracting-data/attributes-text-html请帮助     
已邀请:
Jsoup将您的URL视为要解析的文本,并将其转换为有效的HTML,以便可以对其进行解析。我认为您想连接到该站点并检索该URL的内容,然后解析结果:
Document doc = Jsoup.connect(\"http://skyalipi.blogspot.com/2011/04/there-is-no-resistance-without.html\").get();
编辑 请查看示例文档。您可以执行以下操作:
Element example = doc.getElementById(\"alternatives1\");
Log.d(\"test\",\"example \"+example.text());
    

要回复问题请先登录注册