use nipper::Document; fn main() { let html = r#" "#; let document = Document::from(html); let items = document.select("ul").select("li"); let ul = items.parent(); println!("{}", ul.html()); for mut item in items.next_sibling().iter() { item.remove() } println!("{}", document.select("ul").html()); }