我正在尝试 使用以下代码解析此网站: http ://www.proyectoglass.com/feeds/posts/default?alt=rss:
static final String BLOG_URL = "http://www.proyectoglass.com/feeds/posts/default?alt=rss";
static final String TAG_titular = "rss channel item title";
public ArrayList<String> copia=new ArrayList<String>();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
Document doc = Jsoup.connect(BLOG_URL).get();
Elements links = doc.select(TAG_titular);
for(Element link:links)
{
copia.add(link.text());
}
if(copia.size() == 0) {
copia.add("Empty result");
}
} catch (Exception ex) {
ex.printStackTrace();
copia.clear();
copia.add("Exception: " + ex.toString());
}
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,copia);
setListAdapter(arrayAdapter);
}
然后我收到以下错误:
Exception: org.jsoup.UnsupportedMimeTypeException: Unhandled content Type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=application/rss+xml; charset=UTF-8, URL=http://www.projectglass.com/feed/posts/default?alt=rss
但是在解析的标签内我有文本,任何人都可以帮我看看我做错了什么?
非常感谢。