pub fn select_text(doc: &Document, selector: &str) -> QueryResult<Vec<String>>Expand description
Extracts text content from all elements matching a CSS selector.
Returns the concatenated text content of each matching element. Empty vector if no elements match.
§Errors
Returns [QueryError::InvalidSelector] if the selector syntax is invalid.
§Examples
use scrape_core::{Soup, query::select_text};
let soup = Soup::parse("<div><span>A</span><span>B</span></div>");
let texts = select_text(soup.document(), "span").unwrap();
assert_eq!(texts, vec!["A", "B"]);