-
-
Save MTRNord/443e2f3acce029fabd35b40da5d8b19d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "geckodriver-test" | |
version = "0.1.0" | |
authors = ["MTRNord <mtrnord1@gmail.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
[dependencies.fantoccini] | |
version = "0.17" | |
features = ["rustls-tls"] | |
[dependencies.tokio] | |
version = "1" | |
features = ["full"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use fantoccini::ClientBuilder; | |
#[tokio::main] | |
async fn main() -> Result<(), fantoccini::error::CmdError> { | |
// Connecting using Rustls (with feature `rustls-tls`) | |
let mut c = ClientBuilder::rustls() | |
.connect("http://localhost:4444") | |
.await | |
.expect("failed to connect to WebDriver"); | |
println!("current url: {}", c.current_url().await?); | |
let windows = c.windows().await?; | |
println!("windows: {:#?}", windows); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment