Trim text.

This commit is contained in:
Bauke 2022-10-03 15:31:26 +02:00
parent 691a9b86c8
commit 457d8329ee
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ pub fn select_first_element_text(
parent
.select(selector)
.next()
.map(|element| element.text().collect())
.map(|element| element.text().collect::<String>())
.map(|text| text.trim().to_string())
}
/// Shorthand for creating a [`scraper::Selector`].