pub struct Frame {
pub id: String,
pub page: Arc<Page>,
}Fields§
§id: String§page: Arc<Page>Implementations§
Source§impl Frame
impl Frame
pub fn new(id: String, page: Arc<Page>) -> Self
Sourcepub async fn execution_context_id(&self) -> Result<u32>
pub async fn execution_context_id(&self) -> Result<u32>
Resolves the execution context associated with the frame.
Sourcepub async fn call_function_on(
&self,
function_declaration: &str,
args: Vec<Value>,
) -> Result<Value>
pub async fn call_function_on( &self, function_declaration: &str, args: Vec<Value>, ) -> Result<Value>
Calls JavaScript within the frame’s execution context.
Sourcepub async fn evaluate(&self, script: &str) -> Result<Value>
pub async fn evaluate(&self, script: &str) -> Result<Value>
Evaluates JavaScript within the frame’s execution context.
Sourcepub async fn name(&self) -> Result<Option<String>>
pub async fn name(&self) -> Result<Option<String>>
Returns the window name for the frame, if any.
Sourcepub async fn is_detached(&self) -> bool
pub async fn is_detached(&self) -> bool
Returns true if the frame no longer has a valid execution context.
Sourcepub async fn query_selector(
&self,
selector: &str,
) -> Result<Option<ElementHandle>>
pub async fn query_selector( &self, selector: &str, ) -> Result<Option<ElementHandle>>
Queries the first element in the frame using either CSS or XPath.
CSS selectors look like div.class or #id. XPath selectors start with
xpath: or /, for example //div[@class='test'].
Sourcepub async fn query_selector_all(
&self,
selector: &str,
) -> Result<Vec<ElementHandle>>
pub async fn query_selector_all( &self, selector: &str, ) -> Result<Vec<ElementHandle>>
Queries all matching elements in the frame using CSS or XPath.
Sourcepub async fn call_function_on_with_retry(
&self,
function_declaration: &str,
args: Vec<Value>,
config: RetryConfig,
) -> Result<Value>
pub async fn call_function_on_with_retry( &self, function_declaration: &str, args: Vec<Value>, config: RetryConfig, ) -> Result<Value>
Retries Self::call_function_on using the provided configuration.
Sourcepub async fn evaluate_with_retry(
&self,
script: &str,
config: RetryConfig,
) -> Result<Value>
pub async fn evaluate_with_retry( &self, script: &str, config: RetryConfig, ) -> Result<Value>
Retries Self::evaluate using the provided configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Frame
impl !RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl !UnwindSafe 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