0
我解析在自动模式下的网页与JSOUP并得到这样的错误: org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=image/jpeg,
JSOUP内容类型处理
至于解决方案,它提供here使用ignoreContentType()函数,将“力jsoup忽略的内容类型并将响应解析为HTML'。我不想来解析图片为HTML,那么有没有什么办法处理此类异常或得到这样的内容类型:
if (Contenttype == 'text' or Contenttype == 'xml' or ...what_ever_other_text_format)
parse
else
do_nothing.