日期:2014-05-20  浏览次数:20795 次

JSOUP 如何处理转义字符?
比如我用JSOUP 爬到如下HTML,我如何解析?
比如第一个元素,翻译过来是<div class="item-inner clearfix">xxxx</div>。这样我才能用Element.select("div[class=item-inner clearfix]"); 如果不翻译过来,就取不到这个元素了。如何解决?


&lt;div class=&quot;item-inner clearfix&quot;&gt;

&lt;div class=&quot;photo&quot; data-spm=&quot;1000248&quot;&gt;
&lt;a target=&quot;_blank&quot; href=&quot;http://dd.taobao.com/detail.htm?localstoreId=6f97a76d586e4cb383e669bc81923994&quot; &gt;
&lt;span&gt;        
&lt;img src=&quot;http://img3.tbcdn.cn:80/L1/76/600401658/41a0e57755f44c508fa46386342ff4e2_160x160.jpg&quot; alt=&quot;一茶一坐(金桥店)&quot;&gt;
&lt;/span
&lt;span class=&quot;index&quot;&gt;6&lt;/span
&lt;/a
&lt;/div
&lt;div class=&quot;info&quot;&gt;
&lt;div class=&quot;clearfix&quot; data-spm=&quot;1000256&quot;&gt;
&lt;a target=&quot;_blank&quot; href=&quot;http://dd.taobao.com/detail.htm?localstoreId=6f97a76d586e4cb383e669bc81923994&quot; class=&quot;name&quot;&gt;
一茶一坐(金桥店)
&lt;/a
&lt;a  href=&quot;http://bendi.koubei.com/shanghai/list--q-%D2%BB%B2%E8%D2%BB%D7%F8--isfd-1&quot; class=&quot; branch&quot;&gt;&lt;em&gt;分店&lt;/em&lt;/a
&lt;a target=&quot;_blank&quot; href=&quot;http://dd.taobao.com/detail.htm?localstoreId=6f97a76d586e4cb383e669bc81923994&quot; &gt;
&lt;img src=&quot;http://img03.taobaocdn.com/tps/i3/T1wEaPXq8dXXcKFhzf-39-14.gif&quot;&gt;
&lt;/a
     &lt;a target=&quot;_blank&quot; href=&quot;http://waimai.taobao.com/shop_detail.htm?shopid=46669&amp;city=310100&quot; &gt;
     &lt;img src=&quot;http://img02.taobaocdn.com/tps/i2/T1IZnfXedqXXcVIxzf-39-14.png&quot; alt=&quot;&quot;&gt;
     &lt;/a

&lt;/div
&lt;div class=&quot;more-info clearfix&quot;&gt;
     &lt;div class=&quot;place-tag&quot;&gt;
     &lt;div class=&quot;pingfen&quot;&gt;