pub struct BrowserOptions(/* private fields */);Expand description
Options for a SpiderBrowser created via Spider::browser.
The API key is injected from the Spider client, so it does not need
to be set here. Use the chainable with_* methods to configure the
browser:
use spider_client::{BrowserOptions, Spider};
let spider = Spider::new(Some("myspiderapikey".into())).expect("API key must be provided");
let options = BrowserOptions::new()
.with_browser("chrome")
.with_stealth(2)
.with_country("US");
let browser = spider.browser(Some(options));Implementations§
Source§impl BrowserOptions
impl BrowserOptions
Sourcepub fn with_browser(self, browser: impl Into<String>) -> Self
pub fn with_browser(self, browser: impl Into<String>) -> Self
Set the browser type (e.g. “chrome”, “firefox”, “auto”).
Sourcepub fn with_server_url(self, url: impl Into<String>) -> Self
pub fn with_server_url(self, url: impl Into<String>) -> Self
Override the default WebSocket server URL.
Sourcepub fn with_stealth(self, level: u32) -> Self
pub fn with_stealth(self, level: u32) -> Self
Set the initial stealth level (1-3, 0 = auto-escalate).
Sourcepub fn with_llm(self, config: LLMConfig) -> Self
pub fn with_llm(self, config: LLMConfig) -> Self
Set the LLM configuration for AI-powered actions.
Sourcepub fn with_captcha(self, mode: impl Into<String>) -> Self
pub fn with_captcha(self, mode: impl Into<String>) -> Self
Set the captcha handling mode (“off”, “detect”, “solve”).
Sourcepub fn with_country(self, country: impl Into<String>) -> Self
pub fn with_country(self, country: impl Into<String>) -> Self
Set the country code for geo-located proxies (e.g. “US”, “GB”).
Sourcepub fn with_proxy_url(self, proxy_url: impl Into<String>) -> Self
pub fn with_proxy_url(self, proxy_url: impl Into<String>) -> Self
Set a custom proxy URL (e.g. “http://user:pass@proxy:8080”).
Sourcepub fn with_record(self, record: bool) -> Self
pub fn with_record(self, record: bool) -> Self
Enable or disable screencast recording.
Trait Implementations§
Source§impl Clone for BrowserOptions
impl Clone for BrowserOptions
Source§fn clone(&self) -> BrowserOptions
fn clone(&self) -> BrowserOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BrowserOptions
impl Debug for BrowserOptions
Auto Trait Implementations§
impl Freeze for BrowserOptions
impl RefUnwindSafe for BrowserOptions
impl Send for BrowserOptions
impl Sync for BrowserOptions
impl Unpin for BrowserOptions
impl UnsafeUnpin for BrowserOptions
impl UnwindSafe for BrowserOptions
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