Skip to main content

extract_texts

Function extract_texts 

Source
pub fn extract_texts(raw_html: &str, selector: &str) -> Result<Vec<String>>
Expand description

提取匹配指定选择器的所有文本内容

let html = r#"<html><body><p>段落1</p><p>段落2</p></body></html>"#;
let texts = crawlkit_parser::html::extract_texts(html, "p").unwrap();