<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 從一個文件加載一個文檔 <div><h2>問題</h2> <p>在本機硬盤上有一個HTML文件,需要對它進行解析從中抽取數據或進行修改。</p> <h2>辦法</h2> <p>可以使用靜態 <code><a title="Parse the contents of a file as HTML." href="http://jsoup.org/apidocs/org/jsoup/Jsoup.html#parse%28java.io.File,%20java.lang.String,%20java.lang.String%29">Jsoup.parse(File in, String charsetName, String baseUri)</a></code> 方法:</p> <pre><code>File input = new File("/tmp/input.html"); Document doc = Jsoup.parse(input, "UTF-8", "http://example.com/"); </code></pre> <h2>說明</h2> <p><code><a title="Parse the contents of a file as HTML." href="http://jsoup.org/apidocs/org/jsoup/Jsoup.html#parse%28java.io.File,%20java.lang.String,%20java.lang.String%29">parse(File in, String charsetName, String baseUri)</a></code> 這個方法用來加載和解析一個HTML文件。如在加載文件的時候發生錯誤,將拋出IOException,應作適當處理。</p> <p><code>baseUri</code> 參數用于解決文件中URLs是相對路徑的問題。如果不需要可以傳入一個空的字符串。</p> <p>另外還有一個方法<code><a title="Parse the contents of a file as HTML." href="http://jsoup.org/apidocs/org/jsoup/Jsoup.html#parse%28java.io.File,%20java.lang.String%29">parse(File in, String charsetName)</a></code> ,它使用文件的路徑做為 <code>baseUri</code>。 這個方法適用于如果被解析文件位于網站的本地文件系統,且相關鏈接也指向該文件系統。 </p> <br></div>
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看