2017-05-05 309 views
0

我想刪除一個自定義標籤例如如何刪除自定義標籤在jsoup

<figure class="promo-box vmig slideshow ga-event" data-ga_event-category="Slideshow" data-ga_event-action="SS-Promo-Impression" data-ga_event-label="SS: Newborn Baby Health: 8 Woes From Cradle Cap And Colic To Whooping Cough" data-ga_event-noninteraction="true"> 
<figcaption> 
</figcaption> 
</figure> 

從jsoup元素這整個標籤我已經使用

document.select(".promo-box").remove(); 
    document.select("figure ").remove(); 

,但其沒有工作,也沒有工作對於script標籤

回答

0

它有點棘手..

更換你的TA摹用的div或者你不任何其他HTML標記要使用和刪除..

你的情況

它會是這樣

document.select("figure").tagName("div"); 
document.select("div").remove(); 
+0

作品般的魅力 – doe