Skip to content

Instantly share code, notes, and snippets.

@MTRNord
Created February 3, 2021 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MTRNord/443e2f3acce029fabd35b40da5d8b19d to your computer and use it in GitHub Desktop.
Save MTRNord/443e2f3acce029fabd35b40da5d8b19d to your computer and use it in GitHub Desktop.
[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"]
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