MCPcopy Create free account
hub / github.com/PyO3/setuptools-rust / select

Method select

examples/html-py-ever/rust/lib.rs:20–28  ·  view source on GitHub ↗

Returns the selected elements as strings

(&self, selector: &str)

Source from the content-addressed store, hash-verified

18 impl Document {
19 /// Returns the selected elements as strings
20 fn select(&self, selector: &str) -> PyResult<Vec<String>> {
21 let selector = Selector::parse(selector)
22 .map_err(|e| PyErr::new::<pyo3::exceptions::PyValueError, _>(format!("{e:?}")))?;
23 Ok(self
24 .html
25 .select(&selector)
26 .map(|element| element.html())
27 .collect())
28 }
29 }
30
31 impl Document {

Callers 3

mainFunction · 0.80
rustFunction · 0.80
pythonFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected