Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何使用jsoup从这个html中提取数据_Android_Html_Parsing_Jsoup - Fatal编程技术网

Android 如何使用jsoup从这个html中提取数据

Android 如何使用jsoup从这个html中提取数据,android,html,parsing,jsoup,Android,Html,Parsing,Jsoup,我正在开发一个android应用程序,在其中我必须展示每日圣训。我有一个每天更新圣训的链接。这是该页面的后端html <div class="hadith-explanation" id="hadithcontent"> <h2>Today's Hadith</h2> <br> <h3>Commitments</h3> <br> <p>The Messenger of Allah (sal Allah

我正在开发一个android应用程序,在其中我必须展示每日圣训。我有一个每天更新圣训的链接。这是该页面的后端html

<div class="hadith-explanation" id="hadithcontent">
<h2>Today's Hadith</h2>
<br>
<h3>Commitments</h3>
<br>
<p>The Messenger of Allah (sal Allahu alaihi wa sallam) said: "He has (really) no faith who fulfills not his trust,
   and he has (really) no religion who fulfills not his promise." [Baihaqi]<br /><br />Always keep your word.
   Each time you keep a commitment you are rewarded by Allah (subhana wa ta'ala) for obeying Him. If you mix a few drops of wine in a glass
   full of water, it spoils the whole glass of water and makes it unfit for consumption. Similarly, dishonesty in any sphere of your life
   permeates and corrupts your entire nature and eeman. When a person&rsquo;s words carry no weight, it only reveals his/her treacherous nature.
   <br /><br />If you promise to be somewhere, make sure you are there on time. If you promise to call somebody back, do so on time. Don't commit
   what you cannot do. One minute means 60 seconds everywhere, no more. Make a habit of under-committing rather than over-committing.<br /><br />
   The online version of Daily Hadith is available. Please visit http://dailyhadith.adaptivesolutionsinc.com
</p>

今天的圣训

承诺
安拉的信使(sal Allahu alaihi wa sallam)说:“不履行自己信任的人(真的)没有信仰, 他(真的)没有一个宗教信仰不履行他的诺言。”[拜哈奇]

永远遵守你的诺言。 每次你信守承诺,安拉(subhana wa ta'ala)都会奖励你遵守他的承诺。如果你在玻璃杯里混合几滴酒 装满水,它会破坏整杯水,使其不适合饮用。同样,在你生活中的任何领域都存在不诚实 渗透并腐蚀你的整个本性和灵魂。当一个人;她说的话没有任何分量,只会暴露出他/她背信弃义的本性。

如果你答应去某个地方,一定要准时到达。如果你答应给某人回电话,一定要准时。不要承诺 你不能做的事。一分钟意味着60秒,不多了。养成承诺不足而不是承诺过度的习惯。

每日圣训的在线版本是可用的。请访问http://dailyhadith.adaptivesolutionsinc.com

我想获取从段落标记到第一个br标记的数据。i、 e从“真主的使者”开始,直到[拜哈奇]

我在网上搜索过,发现可以使用jsoup库来完成,但我没有太多的编程知识。请有人给我指点一下。

你可以用

爪哇:

file.html:

<div class="hadith-explanation" id="hadithcontent">
    <h2>Today's Hadith</h2>
    <br>
    <h3>Commitments</h3>
    <br>
    <p>
        The Messenger of Allah (sal Allahu alaihi wa sallam) said: "He has
        (really) no faith who fulfills not his trust, and he has (really) no
        religion who fulfills not his promise." [Baihaqi]<br />
        <br />Always keep your word. Each time you keep a commitment you are
        rewarded by Allah (subhana wa ta'ala) for obeying Him. If you mix a
        few drops of wine in a glass full of water, it spoils the whole glass
        of water and makes it unfit for consumption. Similarly, dishonesty in
        any sphere of your life permeates and corrupts your entire nature and
        eeman. When a person&rsquo;s words carry no weight, it only reveals
        his/her treacherous nature. <br />
        <br />If you promise to be somewhere, make sure you are there on
        time. If you promise to call somebody back, do so on time. Don't
        commit what you cannot do. One minute means 60 seconds everywhere, no
        more. Make a habit of under-committing rather than over-committing.<br />
        <br /> The online version of Daily Hadith is available. Please visit
        http://dailyhadith.adaptivesolutionsinc.com
    </p>
</div>

今天的圣训

承诺
安拉的使者(sal Allahu alaihi wa sallam)说:“他已经 (真的)没有信仰谁不履行他的信任,他(真的)没有 不履行诺言的宗教。”[Baihaqi]

始终遵守诺言。每一次你履行承诺,你就是 安拉(subhana wa ta'ala)因服从他而给予奖励。如果你混合 盛满水的杯子里只有几滴酒,它会把整个杯子都弄坏 使水变得不适合饮用。同样地,不诚实 你生活中的任何领域都渗透并腐蚀着你的整个本性和灵魂 埃曼。当一个人;s的话没有分量,它只揭示了 他/她叛逆的本性

如果你答应去某个地方,一定要准时到达 时间如果你答应给某人回电话,一定要准时。不要 做你不能做的事。一分钟意味着60秒,不是吗 更多养成承诺不足而不是承诺过度的习惯。

每日圣训的在线版本可用。请访问 http://dailyhadith.adaptivesolutionsinc.com

<div class="hadith-explanation" id="hadithcontent">
    <h2>Today's Hadith</h2>
    <br>
    <h3>Commitments</h3>
    <br>
    <p>
        The Messenger of Allah (sal Allahu alaihi wa sallam) said: "He has
        (really) no faith who fulfills not his trust, and he has (really) no
        religion who fulfills not his promise." [Baihaqi]<br />
        <br />Always keep your word. Each time you keep a commitment you are
        rewarded by Allah (subhana wa ta'ala) for obeying Him. If you mix a
        few drops of wine in a glass full of water, it spoils the whole glass
        of water and makes it unfit for consumption. Similarly, dishonesty in
        any sphere of your life permeates and corrupts your entire nature and
        eeman. When a person&rsquo;s words carry no weight, it only reveals
        his/her treacherous nature. <br />
        <br />If you promise to be somewhere, make sure you are there on
        time. If you promise to call somebody back, do so on time. Don't
        commit what you cannot do. One minute means 60 seconds everywhere, no
        more. Make a habit of under-committing rather than over-committing.<br />
        <br /> The online version of Daily Hadith is available. Please visit
        http://dailyhadith.adaptivesolutionsinc.com
    </p>
</div>