2014-02-26 39 views
-1

我是比較新的JSoup .I'm試圖解析HTML代碼的網站是沿着這些線路刮解析這個我怎樣JSoup(開放的替代品)

..... 
    <FONT COLOR=#2D8F26 FACE="Arial"><B>Claim:</B></FONT> &nbsp; Photograph shows a Chicago Bears fan holding a crude sign at the <NOBR>2006-07</NOBR> <NOBR>NFC championship</NOBR> game. 
    <BR><BR> 
    <NOINDEX> 
    <FONT COLOR=#2D8F26 FACE="Arial"><B>Status:</B></FONT> &nbsp; <FONT COLOR=#FF0000 FACE="Arial"><B><I>True.</I></B></FONT> 
    </NOINDEX> 
    <BR><BR> 
    <FONT COLOR=#2D8F26 FACE="Arial"><B>Example:</B></FONT> &nbsp; <FONT COLOR=#2D8F26 FACE="Trebuchet MS,Bookman Old Style,Arial"><I>[Collected via e-mail, January 2007]</I></FONT> 
    <BR><BR> 
    <TABLE WIDTH=400 ALIGN=CENTER BORDER=0 BGCOLOR=#000000><TR><TD BGCOLOR=#EAF2E5> 
    <FONT FACE="Verdana" SIZE=2"> 
    <DIV STYLE="text-align: justify; margin-top: 10px; margin-bottom: 10px; margin-left: 15px; margin-right: 15px"> 
    The attached photo has been circulating around the Gulf Coast region for a couple of days now (since Saturday's Bears-Saints game). Do you have any word on whether it is authentic or doctored? Was this individual really that tasteless and crude? 
    <BR><BR> 
    <CENTER> 
...... 

我期待沿線生成輸出

Claim :Photograph shows a Chicago Bears fan holding a crude sign at the 2006-07 NFC championship game. 
Status:True. 
Example:The attached photo has been circulating around the Gulf Coast region for a couple of days now (since Saturday's Bears-Saints game). Do you have any word on whether it is authentic or doctored? Was this individual really that tasteless and crude? 

在查看JSoup文檔時,它顯示了基於標籤獲取信息的方法。但是我怎樣才能使用JSoup獲得所需的輸出?任何樣品或樣品替代品將不勝感激。

+1

告訴我們你有什麼話想得到的只是文字的一部分? – Pureferret

+0

爲什麼downvote?問題有問題嗎? – KodeSeeker

+0

@ Pureferret:我按照下面的提示。我只是想看看是否有更方便的東西來滿足我的需求 – KodeSeeker

回答

3

我覺得你只是想通過剝離掉HTML entities.Below應該工作

Jsoup.parse("yoursInputString").text();