pub struct SpiderBrowser { /* private fields */ }Expand description
SpiderBrowser — connects to Spider’s pre-warmed browser fleet.
Provides deterministic page control (via SpiderPage) and AI-powered automation (act, observe, extract, agent).
Implementations§
Source§impl SpiderBrowser
impl SpiderBrowser
pub fn new(options: SpiderBrowserOptions) -> Self
Sourcepub fn page(&self) -> &SpiderPage
pub fn page(&self) -> &SpiderPage
The active page instance for deterministic browser control.
Sourcepub fn stealth_level(&self) -> u32
pub fn stealth_level(&self) -> u32
Active stealth level.
Sourcepub fn session_credits_used(&self) -> Option<f64>
pub fn session_credits_used(&self) -> Option<f64>
Credits consumed during this session.
Sourcepub fn on(&self, event: &str, handler: EventHandler)
pub fn on(&self, event: &str, handler: EventHandler)
Subscribe to events.
Sourcepub async fn init(&mut self) -> Result<()>
pub async fn init(&mut self) -> Result<()>
Connect to the browser fleet and initialize the protocol.
Sourcepub async fn act(&self, instruction: &str) -> Result<()>
pub async fn act(&self, instruction: &str) -> Result<()>
Execute a single action from natural language.
Sourcepub async fn observe(
&self,
instruction: Option<&str>,
) -> Result<Vec<ObserveResult>>
pub async fn observe( &self, instruction: Option<&str>, ) -> Result<Vec<ObserveResult>>
Discover interactive elements on the page.
Sourcepub async fn extract<T: DeserializeOwned + Send>(
&self,
instruction: &str,
) -> Result<T>
pub async fn extract<T: DeserializeOwned + Send>( &self, instruction: &str, ) -> Result<T>
Extract structured data from the page.
Sourcepub fn agent(&self, options: Option<AgentOptions>) -> Agent<'_>
pub fn agent(&self, options: Option<AgentOptions>) -> Agent<'_>
Create an autonomous agent.
Auto Trait Implementations§
impl !Freeze for SpiderBrowser
impl !RefUnwindSafe for SpiderBrowser
impl !UnwindSafe for SpiderBrowser
impl Send for SpiderBrowser
impl Sync for SpiderBrowser
impl Unpin for SpiderBrowser
impl UnsafeUnpin for SpiderBrowser
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