pub struct Frame { /* private fields */ }Expand description
A frame in a page. The main frame wraps the page’s top-level document.
Implementations§
Source§impl Frame
impl Frame
pub fn name(&self) -> String
pub fn url(&self) -> String
pub fn parent_frame(&self) -> Option<Frame>
pub fn child_frames(&self) -> Vec<Frame>
pub fn is_detached(&self) -> bool
Sourcepub async fn evaluate<R: DeserializeOwned>(&self, expression: &str) -> Result<R>
pub async fn evaluate<R: DeserializeOwned>(&self, expression: &str) -> Result<R>
Evaluate expression in this frame’s main world.
Sourcepub async fn goto(
&self,
url: &str,
opts: Option<GotoOptions>,
) -> Result<Option<Response>>
pub async fn goto( &self, url: &str, opts: Option<GotoOptions>, ) -> Result<Option<Response>>
Navigate this frame to url (main frame only).
pub async fn wait_for_load_state(&self, state: Option<WaitUntil>) -> Result<()>
Sourcepub async fn wait_for_function<R: DeserializeOwned>(
&self,
expression: &str,
arg: Option<Value>,
options: Option<WaitForFunctionOptions>,
) -> Result<R>
pub async fn wait_for_function<R: DeserializeOwned>( &self, expression: &str, arg: Option<Value>, options: Option<WaitForFunctionOptions>, ) -> Result<R>
Poll expression until truthy (delegates to the page). See
Page::wait_for_function.
pub async fn content(&self) -> Result<String>
pub async fn set_content(&self, html: &str) -> Result<()>
pub async fn title(&self) -> Result<String>
pub fn locator(&self, selector: impl Into<String>) -> Locator
pub fn get_by_text(&self, text: &str, exact: bool) -> Locator
pub fn get_by_label(&self, text: &str) -> Locator
pub fn get_by_role( &self, role: AriaRole, opts: Option<GetByRoleOptions>, ) -> Locator
Sourcepub async fn query_selector(
&self,
selector: &str,
) -> Result<Option<ElementHandle>>
pub async fn query_selector( &self, selector: &str, ) -> Result<Option<ElementHandle>>
The first element matching selector, if any.
Sourcepub async fn query_selector_all(
&self,
selector: &str,
) -> Result<Vec<ElementHandle>>
pub async fn query_selector_all( &self, selector: &str, ) -> Result<Vec<ElementHandle>>
All elements matching selector.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Frame
impl !UnwindSafe for Frame
impl Freeze for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more