pub struct PlaywrightDriverPage { /* private fields */ }Expand description
EngineAdapter backed by the official Playwright driver.
Implementations§
Source§impl PlaywrightDriverPage
impl PlaywrightDriverPage
Sourcepub async fn launch(options: PlaywrightLaunch) -> Result<Self, ProtocolError>
pub async fn launch(options: PlaywrightLaunch) -> Result<Self, ProtocolError>
Start a driver and launch a persistent context through it.
Sourcepub async fn launch_with(
driver: PlaywrightDriver,
options: PlaywrightLaunch,
) -> Result<Self, ProtocolError>
pub async fn launch_with( driver: PlaywrightDriver, options: PlaywrightLaunch, ) -> Result<Self, ProtocolError>
Launch a persistent context through a running driver.
Sourcepub async fn connect(options: PlaywrightConnect) -> Result<Self, ProtocolError>
pub async fn connect(options: PlaywrightConnect) -> Result<Self, ProtocolError>
Start a driver and attach it to a running browser over CDP.
Sourcepub async fn connect_with(
driver: PlaywrightDriver,
options: PlaywrightConnect,
) -> Result<Self, ProtocolError>
pub async fn connect_with( driver: PlaywrightDriver, options: PlaywrightConnect, ) -> Result<Self, ProtocolError>
Attach a running driver to a running browser over CDP.
Sourcepub fn driver(&self) -> &PlaywrightDriver
pub fn driver(&self) -> &PlaywrightDriver
The driver this page talks to.
Sourcepub fn objects(&self) -> (&Browser, &BrowserContext, &Page, &Frame)
pub fn objects(&self) -> (&Browser, &BrowserContext, &Page, &Frame)
The typed browser, context, page and main frame, for everything the
EngineAdapter surface does not cover.
Sourcepub async fn close(&self) -> Result<(), EngineError>
pub async fn close(&self) -> Result<(), EngineError>
Close the browser (a launched one) or disconnect from it (an attached one), then stop the driver.
Trait Implementations§
Source§impl Debug for PlaywrightDriverPage
impl Debug for PlaywrightDriverPage
Source§impl EngineAdapter for PlaywrightDriverPage
impl EngineAdapter for PlaywrightDriverPage
Source§fn engine_type(&self) -> EngineType
fn engine_type(&self) -> EngineType
Get the engine type.
Source§fn url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current page URL.
Source§fn goto<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn goto<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Navigate to a URL.
Source§fn query_selector<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ElementInfo>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_selector<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ElementInfo>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query for a single element.
Source§fn query_selector_all<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ElementInfo>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_selector_all<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ElementInfo>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query for all matching elements.
Source§fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count matching elements.
Source§fn click<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn click<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Click an element.
Source§fn mouse_click<'life0, 'async_trait>(
&'life0 self,
x: f64,
y: f64,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mouse_click<'life0, 'async_trait>(
&'life0 self,
x: f64,
y: f64,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Click at viewport coordinates, without scrolling anything into view. Read more
Source§fn fill<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
text: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fill<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
text: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fill an input element with text.
Source§fn type_text<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
text: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn type_text<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
text: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Type text into an element (simulating key presses).
Source§fn text_content<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn text_content<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the text content of an element.
Source§fn input_value<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn input_value<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the value of an input element.
Source§fn get_attribute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
attribute: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_attribute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
selector: &'life1 str,
attribute: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get an attribute value from an element.
Source§fn is_visible<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_visible<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an element is visible.
Source§fn is_enabled<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_enabled<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an element is enabled.
Source§fn wait_for_selector<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_selector<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wait for a selector to appear.
Source§fn scroll_into_view<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn scroll_into_view<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Scroll an element into view.
Source§fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Evaluate JavaScript in the page context.
Source§fn read_browser_version_page<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_browser_version_page<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read
chrome://version in a fresh tab without changing the current page.Source§fn restore_storage_state<'life0, 'async_trait>(
&'life0 self,
state: Value,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restore_storage_state<'life0, 'async_trait>(
&'life0 self,
state: Value,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Restore portable cookies and origin-scoped localStorage before navigation.
Source§fn export_storage_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn export_storage_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Export portable cookies and the current page’s localStorage.
Source§fn screenshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn screenshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Take a screenshot.
Source§fn pdf<'life0, 'async_trait>(
&'life0 self,
options: PdfOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pdf<'life0, 'async_trait>(
&'life0 self,
options: PdfOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a PDF of the current page. Read more
Source§fn bring_to_front<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bring_to_front<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Bring the page to front.
Wait for navigation to complete.
Source§fn keyboard_press<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn keyboard_press<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Press a key at the page level (e.g. “Escape”, “Enter”, “Tab”). Read more
Source§fn keyboard_type<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn keyboard_type<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Type text at the page level (dispatches key events for each character).
Source§fn keyboard_down<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn keyboard_down<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Hold a key down at the page level. Must be paired with
keyboard_up.Source§fn keyboard_up<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn keyboard_up<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Release a held key at the page level.
Source§fn add_init_script<'life0, 'life1, 'async_trait>(
&'life0 self,
_script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_init_script<'life0, 'life1, 'async_trait>(
&'life0 self,
_script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run
script in every document the page loads from now on; an
identifier for EngineAdapter::remove_init_script, or None when the
engine cannot (the default).Source§fn remove_init_script<'life0, 'life1, 'async_trait>(
&'life0 self,
_identifier: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_init_script<'life0, 'life1, 'async_trait>(
&'life0 self,
_identifier: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop running a script added with
EngineAdapter::add_init_script.Source§fn trace_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'static, TraceEngineEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn trace_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'static, TraceEngineEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A stream of page activity for a trace recorder, or
None when the
engine does not report any (the default).Auto Trait Implementations§
impl !RefUnwindSafe for PlaywrightDriverPage
impl !UnwindSafe for PlaywrightDriverPage
impl Freeze for PlaywrightDriverPage
impl Send for PlaywrightDriverPage
impl Sync for PlaywrightDriverPage
impl Unpin for PlaywrightDriverPage
impl UnsafeUnpin for PlaywrightDriverPage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more