We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the case, select tags which are siblings of a tag containing some text.
I don't have clue to do that... It would be great to have a method, find by name, like BeautifulSoup.
Thank you
The text was updated successfully, but these errors were encountered:
To get text of the sibling, this code works but look bad to me
fn find(html: &str, selector: Arc<Selector>, text: &str) -> String { let document = Html::parse_fragment(&html); document .select(&selector) .filter(|e| { let trimed = e.text().next().map(|e| e.trim()); trimed == Some(text) }) .flat_map(|e| e.next_sibling_element()) .map(|e| e.text().collect::<String>()) .map(|s| s.trim().to_string()) .collect() }
Sorry, something went wrong.
No branches or pull requests
In the case, select tags which are siblings of a tag containing some text.
I don't have clue to do that...
It would be great to have a method, find by name, like BeautifulSoup.
Thank you
The text was updated successfully, but these errors were encountered: