Skip to main content

ScraperConfig

Struct ScraperConfig 

Source
pub struct ScraperConfig {
    pub headless: bool,
    pub max_scroll_iterations: usize,
    pub enrich: bool,
    pub between_query_delay: Duration,
    pub place_panel_delay: Duration,
    pub place_panel_jitter: Duration,
    pub max_places: Option<usize>,
    pub nav_timeout: Duration,
    pub proxy: Option<String>,
    pub user_agent: Option<String>,
    pub browserless_url: Option<String>,
}
Expand description

Scraper configuration.

Fields§

§headless: bool

Run Chrome in headless mode (default: true). Use false for debugging.

§max_scroll_iterations: usize

How many scrollTop = scrollHeight iterations to perform per search before assuming the feed is exhausted. Default: 30.

§enrich: bool

If false, skip clicking each result and only return surface data (name, maps_url) — much faster but no website / phone. Default: true.

§between_query_delay: Duration

Delay between consecutive HTTP requests inside Chrome.

§place_panel_delay: Duration

Per-place delay after clicking (gives the panel time to render). The effective wait is this plus a random 0..=place_panel_jitter — see ScraperConfig::place_panel_jitter.

§place_panel_jitter: Duration

Upper bound on the random extra delay added on top of ScraperConfig::place_panel_delay before each place visit. A fresh value in 0..=place_panel_jitter is drawn per place to de-regularise the request cadence (mild bot-detection mitigation, not a guarantee). The jitter is purely additive, so place_panel_delay is always the minimum; set this to Duration::ZERO to disable it. Default: 750 ms.

§max_places: Option<usize>

Maximum number of unique places to return per query.

None (default) means unlimited — a dense query (e.g. a feed of several hundred results) will then perform one Chrome navigation per place with no upper bound, so a single call can run for many minutes. Set this when you need to bound run time. Note the cap counts added (deduplicated) places, so in enrich mode a few extra navigations may still occur for duplicates before the cap is reached (in non-enrich mode dedup is pre-navigation, so no navigations are wasted).

§nav_timeout: Duration

Timeout for each page navigation / JS evaluation step. Default: 30s.

§proxy: Option<String>

Optional proxy passed to Chrome as --proxy-server=<value>. If None, falls back to the PROXY_URL environment variable. The value must not contain whitespace (rejected at launch).

§user_agent: Option<String>

Optional User-Agent override.

None (default) leaves Chrome to report its own, always-current UA, which stays consistent with the real TLS/HTTP2 fingerprint. Set this only if you need to pin a specific UA string.

§browserless_url: Option<String>

Optional WebSocket URL of a remote Chrome (e.g. a Browserless instance) to connect to instead of launching a local browser. If None, falls back to the BROWSERLESS_URL environment variable.

When set, the browser is reached via Browser::connect, so local launch arguments (headless, proxy, window size, user agent) are controlled by the remote endpoint and ignored here.

Trait Implementations§

Source§

impl Clone for ScraperConfig

Source§

fn clone(&self) -> ScraperConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScraperConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScraperConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more