pub struct ScrapeConfigBuilder { /* private fields */ }Expand description
Builder for ScrapeConfig.
Implementations§
Source§impl ScrapeConfigBuilder
impl ScrapeConfigBuilder
Sourcepub fn method(self, m: HttpMethod) -> Self
pub fn method(self, m: HttpMethod) -> Self
Set HTTP method.
Set a cookie.
Sourcepub fn proxy_pool(self, p: ProxyPool) -> Self
pub fn proxy_pool(self, p: ProxyPool) -> Self
Set proxy pool.
Sourcepub fn cache_clear(self, v: bool) -> Self
pub fn cache_clear(self, v: bool) -> Self
Force cache refresh.
Sourcepub fn cost_budget(self, v: u32) -> Self
pub fn cost_budget(self, v: u32) -> Self
Set the maximum API credit cost the caller will accept for this request. The server rejects the request pre-flight if its estimate exceeds the budget, so callers get a fast failure instead of a surprise bill.
Sourcepub fn session_sticky_proxy(self, v: bool) -> Self
pub fn session_sticky_proxy(self, v: bool) -> Self
Sticky proxy in a session.
Set all tags.
Sourcepub fn correlation_id(self, v: impl Into<String>) -> Self
pub fn correlation_id(self, v: impl Into<String>) -> Self
Set correlation ID.
Sourcepub fn format_option(self, v: FormatOption) -> Self
pub fn format_option(self, v: FormatOption) -> Self
Add a format option.
Sourcepub fn extraction_template(self, v: impl Into<String>) -> Self
pub fn extraction_template(self, v: impl Into<String>) -> Self
Set saved extraction template name.
Sourcepub fn extraction_ephemeral_template(self, v: Value) -> Self
pub fn extraction_ephemeral_template(self, v: Value) -> Self
Set inline extraction template.
Sourcepub fn extraction_prompt(self, v: impl Into<String>) -> Self
pub fn extraction_prompt(self, v: impl Into<String>) -> Self
Set AI extraction prompt.
Sourcepub fn extraction_model(self, v: ExtractionModel) -> Self
pub fn extraction_model(self, v: ExtractionModel) -> Self
Set extraction model.
Sourcepub fn wait_for_selector(self, v: impl Into<String>) -> Self
pub fn wait_for_selector(self, v: impl Into<String>) -> Self
Set wait-for-selector.
Sourcepub fn rendering_wait(self, v: u32) -> Self
pub fn rendering_wait(self, v: u32) -> Self
Set extra rendering wait (ms).
Sourcepub fn auto_scroll(self, v: bool) -> Self
pub fn auto_scroll(self, v: bool) -> Self
Enable auto-scroll.
Sourcepub fn screenshot(
self,
name: impl Into<String>,
selector: impl Into<String>,
) -> Self
pub fn screenshot( self, name: impl Into<String>, selector: impl Into<String>, ) -> Self
Add a named screenshot.
Sourcepub fn screenshot_flag(self, v: ScreenshotFlag) -> Self
pub fn screenshot_flag(self, v: ScreenshotFlag) -> Self
Add a screenshot flag.
Sourcepub fn js_scenario(self, v: Value) -> Self
pub fn js_scenario(self, v: Value) -> Self
Set JS scenario (as serde_json::Value).
Sourcepub fn browser_brand(self, v: impl Into<String>) -> Self
pub fn browser_brand(self, v: impl Into<String>) -> Self
Set browser brand.
Sourcepub fn geolocation(self, v: impl Into<String>) -> Self
pub fn geolocation(self, v: impl Into<String>) -> Self
Enable proxified response mode (raw upstream pass-through).
Spoof browser geolocation. Format: "latitude,longitude".
Sourcepub fn rendering_stage(self, v: impl Into<String>) -> Self
pub fn rendering_stage(self, v: impl Into<String>) -> Self
Set page load stage: "complete" (default) or "domcontentloaded".
pub fn proxified_response(self) -> Self
Sourcepub fn build(self) -> Result<ScrapeConfig, ScrapflyError>
pub fn build(self) -> Result<ScrapeConfig, ScrapflyError>
Finalize the builder, enforcing the mutual-exclusion rules for the extraction fields.
Trait Implementations§
Source§impl Clone for ScrapeConfigBuilder
impl Clone for ScrapeConfigBuilder
Source§fn clone(&self) -> ScrapeConfigBuilder
fn clone(&self) -> ScrapeConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more