2014-02-26 32 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();