第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

jsoup如何禁止格式化文檔元素?

jsoup如何禁止格式化文檔元素?

德瑪西亞99 2019-03-28 19:11:34
使用jsoup分析html,需要獲取某個(gè)元素的html代碼,并且要求代碼不要格式化(縮進(jìn)和換行)。使用jsoup獲取到此元素之后,tostring方法返回的結(jié)果直接對代碼進(jìn)行了格式化。請問如何禁止jsoup對代碼進(jìn)行格式化?
查看完整描述

1 回答

?
12345678_0001

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊

Document.outputSettings().prettyPrint(false);


/**

* Get if pretty printing is enabled. Default is true. If disabled, the HTML output methods will not re-format

* the output, and the output will generally look like the input.

* @return if pretty printing is enabled.

*/

public boolean prettyPrint() {

    return prettyPrint;

}


/**

 * Enable or disable pretty printing.

 * @param pretty new pretty print setting

 * @return this, for chaining

 */

public OutputSettings prettyPrint(boolean pretty) {

    prettyPrint = pretty;

    return this;

}


查看完整回答
反對 回復(fù) 2019-04-25
  • 1 回答
  • 0 關(guān)注
  • 567 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)