use scraper::{Html, Selector}; fn main() { let html = r#"
新闻 hao123 地图 贴吧 视频 图片 网盘 文库
"#; let fragment = Html::parse_fragment(html); let selector = Selector::parse("#s-top-left > a").unwrap(); for element in fragment.select(&selector) { println!("{}", element.text().collect::>().join("")) } }