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.