Skip to content

Commit e0f3905

Browse files
authored
Merge pull request #306 from stevepryde/claude/funny-franklin-89511a
Use WebDriver::managed in README and lib.rs example
2 parents ffd31c8 + 515813a commit e0f3905

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

thirtyfour/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use thirtyfour::prelude::*;
4444
#[tokio::main]
4545
async fn main() -> WebDriverResult<()> {
4646
let caps = DesiredCapabilities::chrome();
47-
let driver = WebDriver::new("http://localhost:9515", caps).await?;
47+
let driver = WebDriver::managed(caps).await?;
4848

4949
// Navigate to https://wikipedia.org.
5050
driver.goto("https://wikipedia.org").await?;

thirtyfour/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@
3636
//! ## Example
3737
//!
3838
//! The following example assumes you have a compatible version of Chrome
39-
//! installed and `chromedriver` running on port 4444.
39+
//! installed. [`WebDriver::managed`] auto-downloads the matching
40+
//! `chromedriver`, starts it locally, and shuts it down when the session is
41+
//! dropped.
4042
//!
4143
//! ```no_run
4244
//! use thirtyfour::prelude::*;
4345
//!
4446
//! #[tokio::main]
4547
//! async fn main() -> color_eyre::Result<()> {
4648
//! let caps = DesiredCapabilities::chrome();
47-
//! let driver = WebDriver::new("http://localhost:4444", caps).await?;
49+
//! let driver = WebDriver::managed(caps).await?;
4850
//!
4951
//! // Navigate to https://wikipedia.org.
5052
//! driver.goto("https://wikipedia.org").await?;

0 commit comments

Comments
 (0)