Parser JSoup change the tags to lower case letter

前端 未结 5 1036
灰色年华
灰色年华 2020-12-20 15:39

I did some research and it seems that is standard Jsoup make this change. I wonder if there is a way to configure this or is there some other Parser I can be converted to a

5条回答
  •  無奈伤痛
    2020-12-20 16:15

    You must use xmlParser instead of htmlParser and the tags will remain unchanged. One line does the trick:

    String html = "some text";
    Document doc = Jsoup.parse(html, "", Parser.xmlParser());
    

提交回复
热议问题