#[non_exhaustive]pub struct Page {
pub html: String,
pub inner_text: String,
pub title: Option<String>,
pub layout_json: Option<String>,
pub js_result: Option<String>,
pub console_messages: Vec<ConsoleMessage>,
pub accessibility_tree: Option<String>,
/* private fields */
}Expand description
Rendered page returned by fetch.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.html: StringFully rendered HTML after JavaScript execution.
inner_text: StringPlain text content (document.body.innerText).
title: Option<String>Page title extracted from <title> tag.
layout_json: Option<String>Parsed layout data from the injected CSS heuristics script.
js_result: Option<String>Result of JavaScript evaluation, if FetchOptions::javascript was used.
console_messages: Vec<ConsoleMessage>Browser console messages captured during page load.
accessibility_tree: Option<String>Accessibility tree (AccessKit), if requested.
Implementations§
Source§impl Page
impl Page
Sourcepub fn markdown_with_url(&self, url: &str) -> Result<String>
pub fn markdown_with_url(&self, url: &str) -> Result<String>
Extract readable Markdown, using the original URL for link resolution.
Sourcepub fn extract_json(&self) -> Result<String>
pub fn extract_json(&self) -> Result<String>
Extract structured JSON from this page.
Sourcepub fn extract_json_with_url(&self, url: &str) -> Result<String>
pub fn extract_json_with_url(&self, url: &str) -> Result<String>
Extract structured JSON, using the original URL for link resolution.
Sourcepub fn screenshot_png(&self) -> Option<&[u8]>
pub fn screenshot_png(&self) -> Option<&[u8]>
PNG screenshot bytes, if captured via FetchOptions::screenshot.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnsafeUnpin for Page
impl UnwindSafe for Page
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert