You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I downloaded the corresponding version of chromedriver and ran this command .\chromedriver.exe --port=4444
Refer to the example, my code is as follows, but there is no startup response.
use fantoccini::{ClientBuilder,Locator};fnmain(){start();}asyncfnstart(){let c = ClientBuilder::native().connect("http://localhost:4444").await.expect("failed to connect to WebDriver");
c.goto("https://www.google.com").await.unwrap();}
The text was updated successfully, but these errors were encountered:
It's impossible to debug this without information about what errors you got and what else actually happened. Could you include some information about the output you've gotten as well?
@CarbonPool If this is token for token what you are running, one thing is missing: we will need a runtime (like tokio) to drive the future returned by start() to completion.
So if we block on the future in the main, there should be a startup response. Alternatively, we could await with start().await, but then the fn main should be turned to async fn main with the tokio::main attribute on it (which creates a runtime and a blocks on the given future for us).
use fantoccini::ClientBuilder;#[tokio::main]asyncfnmain(){start().await;}asyncfnstart(){let c = ClientBuilder::native().connect("http://localhost:4444").await.expect("failed to connect to WebDriver");
c.goto("https://www.google.com").await.unwrap();}
The tokio::main is behind rt and macros features, so it should be accounted for in the project's Cargo.toml:
[dependencies]
fantoccini = "0.21.4"tokio = { version = "1.43.0", features = ["macros", "rt-multi-thread"] }
I downloaded the corresponding version of chromedriver and ran this command
.\chromedriver.exe --port=4444
Refer to the example, my code is as follows, but there is no startup response.
The text was updated successfully, but these errors were encountered: