Jsoup爬取微信文章报错org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

最近在用jsoup爬取微信文章时Jsoup.connect(listurl).userAgent("Mozilla/5.0").timeout(3000).post();报错org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.,百度的大部分答案都是添加参数ignoreContentType(true),但是修改后并没爬取到正确的文章结构。可将post修改为get重试Jsoup.connect(listurl).userAgent("Mozilla/5.0").timeout(3000).get()。

posted @ 2018-08-21 16:37  Maylove  阅读(1100)  评论(0编辑  收藏  举报