Struct fantoccini::Element
[−]
[src]
pub struct Element { /* fields omitted */ }
A single element on the current page.
Methods
impl Element
[src]
fn attr(
self,
attribute: &str
) -> impl Future<Item = Option<String>, Error = CmdError> + 'static
self,
attribute: &str
) -> impl Future<Item = Option<String>, Error = CmdError> + 'static
Look up an attribute value for this element by name.
Ok(None)
is returned if the element does not have the given attribute.
fn prop(
self,
prop: &str
) -> impl Future<Item = Option<String>, Error = CmdError> + 'static
self,
prop: &str
) -> impl Future<Item = Option<String>, Error = CmdError> + 'static
Look up a DOM property for this element by name.
Ok(None)
is returned if the element does not have the given property.
fn text(self) -> impl Future<Item = String, Error = CmdError> + 'static
Retrieve the text contents of this elment.
fn html(
self,
inner: bool
) -> impl Future<Item = String, Error = CmdError> + 'static
self,
inner: bool
) -> impl Future<Item = String, Error = CmdError> + 'static
Retrieve the HTML contents of this element.
inner
dictates whether the wrapping node's HTML is excluded or not. For example, take the
HTML:
<div id="foo"><hr /></div>
With inner = true
, <hr />
would be returned. With inner = false
,
<div id="foo"><hr /></div>
would be returned instead.
fn click(self) -> impl Future<Item = Client, Error = CmdError> + 'static
Simulate the user clicking on this element.
Note that since this may result in navigation, we give up the handle to the element.
fn follow(self) -> impl Future<Item = Client, Error = CmdError> + 'static
Follow the href
target of the element matching the given CSS selector without causing a
click interaction.
Note that since this may result in navigation, we give up the handle to the element.