简体   繁体   English

Jsoup,从Elements中删除Elements

[英]Jsoup, remove Elements from Elements

So I got several Elements captured and I want to remove these out of another captured Elements. 因此,我捕获了几个元素,并希望将它们从另一个捕获的元素中删除。

My Code looks like this: 我的代码如下所示:

   try {
        doc = Jsoup.connect(url).get();
    } catch (IOException ex) {
        Logger.getLogger(FullFrame.class.getName()).log(Level.SEVERE, null, ex);
    }

    Elements remove = doc.select("cssquerytofindremoveElements");

I now got my Elements which I want to remove, let's say I got antoher 我现在有想要删除的Elements,假设我已经

Elements el = doc.select("cssquery");

I want to remove the Elements I selected before ("remove") from the Elements I selected just now ("el"). 我想从刚才选择的元素(“ el”)中删除之前选择的元素(“删除”)。

Big thanks to everyone helping :) 非常感谢大家的帮助:)

你去,繁荣!

el.select("cssquerytofindremoveElements").remove();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM