v1.99.30
spider-rs/spiderv1.99.30Aug 7, 2024by j-mendez
AI Summary
Introduced web automation steps for Chrome, including viewport handling and specific actions.
Key Highlights
- Web automation steps (Evaluate, Scroll, Click, Wait)
- Internal ViewPort for Chrome
- Partial eq configuration
New Features
- Web automation steps
- Internal ViewPort
- Screenshot automation
Full Release Notes
# Whats Changed
* feat Web automation steps by target url or path.
* add internal ViewPort for chrome handling.
* add partial eq configuration
```rust
let mut automation_scripts = HashMap::new();
automation_scripts.insert(
"/en/blog".into(),
Vec::from([
WebAutomation::Evaluate(r#"document.body.style.background = "blue";"#.into()),
WebAutomation::ScrollY(2000),
WebAutomation::Click("article a".into()),
WebAutomation::Wait(5000),
WebAutomation::Screenshot {
output: "example.png".into(),
full_page: true,
omit_background: true,
},
]),
);
let mut website: Website = Website::new("https://rsseau.fr/en/blog")
.with_chrome_intercept(true, true)
.with_wait_for_idle_network(Some(WaitForIdleNetwork::new(Some(Duration::from_secs(30)))))
.with_caching(cfg!(feature = "cache"))
.with_limit(1)
.with_automation_scripts(Some(automation_scripts))
.build()
.unwrap();
```
https://github.com/user-attachments/assets/e2b995e1-ef33-462e-9652-febdee56935a
**Full Changelog**: https://github.com/spider-rs/spider/compare/v1.99.21...v1.99.30