pub struct BrowserPage { /* private fields */ }Implementations§
Source§impl BrowserPage
impl BrowserPage
pub fn id(&self) -> &str
Sourcepub fn blocked_requests(&self) -> Vec<BlockedRequest>
pub fn blocked_requests(&self) -> Vec<BlockedRequest>
Requests the network policy refused on this page (redirect hops and subresources included).
pub async fn bring_to_front(&self) -> Result<()>
pub async fn goto(&self, url: &str) -> Result<()>
pub async fn reload(&self) -> Result<()>
pub async fn history(&self, delta: i32) -> Result<()>
pub async fn url(&self) -> String
pub async fn title(&self) -> String
Sourcepub async fn eval(&self, expr: &str) -> Result<Value>
pub async fn eval(&self, expr: &str) -> Result<Value>
Evaluate a JS expression and return its JSON value. Script can navigate and act, so it is admitted like any other effect.
pub async fn set_viewport( &self, width: u32, height: u32, scale: f64, ) -> Result<()>
pub async fn observe(&self) -> Result<Observation>
pub async fn hover(&self, target: &Target) -> Result<()>
pub async fn click(&self, target: &Target) -> Result<()>
pub async fn double_click(&self, target: &Target) -> Result<()>
Sourcepub async fn drag(&self, from: &Target, to: &Target, steps: u32) -> Result<()>
pub async fn drag(&self, from: &Target, to: &Target, steps: u32) -> Result<()>
Press at from, move in steps increments, release at to.
Sourcepub async fn wheel(&self, at: Option<&Target>, dx: f64, dy: f64) -> Result<()>
pub async fn wheel(&self, at: Option<&Target>, dx: f64, dy: f64) -> Result<()>
Mouse-wheel scroll at the target (or viewport centre when None).
Sourcepub async fn press(&self, spec: &str) -> Result<()>
pub async fn press(&self, spec: &str) -> Result<()>
Press a key or chord (Enter, Tab, Control+a) on the focused element.
Sourcepub async fn type_text(&self, text: &str) -> Result<()>
pub async fn type_text(&self, text: &str) -> Result<()>
Type text one key event at a time into the focused element.
Sourcepub async fn fill(&self, target: &Target, text: &str, clear: bool) -> Result<()>
pub async fn fill(&self, target: &Target, text: &str, clear: bool) -> Result<()>
Click the target to focus it, then type.
Sourcepub async fn select_option(&self, target: &Target, value: &str) -> Result<()>
pub async fn select_option(&self, target: &Target, value: &str) -> Result<()>
Choose a <select> option by value/label. Native popups cannot be driven
over CDP, so this sets the value and fires input/change (documented gap).
pub async fn upload(&self, target: &Target, file: &Path) -> Result<()>
pub async fn wait_for(&self, selector: &str, timeout: Duration) -> Result<()>
Sourcepub async fn wait_eval(&self, expr: &str, timeout: Duration) -> Result<()>
pub async fn wait_eval(&self, expr: &str, timeout: Duration) -> Result<()>
Poll a JS expression until truthy.
pub async fn screenshot(&self) -> Result<Vec<u8>>
pub async fn screenshot_to(&self, path: &Path) -> Result<()>
pub async fn console(&self) -> Vec<ConsoleLine>
pub async fn clear_console(&self)
Auto Trait Implementations§
impl !Freeze for BrowserPage
impl !RefUnwindSafe for BrowserPage
impl !UnwindSafe for BrowserPage
impl Send for BrowserPage
impl Sync for BrowserPage
impl Unpin for BrowserPage
impl UnsafeUnpin for BrowserPage
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