1

I cannot get the data of this with Jsoup. It can connect if I use this:

Connection connection = Jsoup.connect("http://android-forum.hu/feed.php");

But if I want to get the site data I got this exeption:

org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=application/atom+xml; charset=UTF-8, URL=http://android-forum.hu/feed.php

I use this code:

Document doc = Jsoup.connect("http://android-forum.hu/feed.php").get();

So I want to get the page data. How to get it?

Zoltan Szilagyi
  • 292
  • 3
  • 16

1 Answers1

1

The UnsupportedMimeTypeException is thrown when the minetype of the response is not supported.

You can use ignoreContentType(true) to let Jsoup ignore minetype, try

Document doc = Jsoup.connect("http://android-forum.hu/feed.php")
                    .ignoreContentType(true)
                    .get();

(call it before .get)

Marco Acierno
  • 14,682
  • 8
  • 43
  • 53
  • Also if the data contains unsupported character like "á" how to write to the screen? Because I got "&" or ";" or something like that... – Zoltan Szilagyi Sep 13 '14 at 18:49
  • If you get the HTML encoding chars, just decode them check this question too http://stackoverflow.com/questions/13750290/how-to-decode-html-codes-using-java – Marco Acierno Sep 13 '14 at 18:51