
Chromedriver API (auto clicker)
Introduction:
This API is designed for interacting with chromedriver (browser auto clicker).
Basic Methods:
- .open(URL) - Open URL-address on Chrome browser window
- .inject(JS_SCRIPT) - Inject JavaScript code to process
- .click(CSS_SELECTOR) - Click to element by CSS selector
- .value(CSS_SELECTOR, VALUE) - Change element value by CSS selector
Examples:
use chromedriver_api::{ Result, Session };
use tokio::time::{ sleep, Duration };
#[tokio::main]
async fn main() -> Result<()> {
let mut session = Session::run("54477", Some("C:\\Users\\Synap\\AppData\\Local\\Google\\Chrome\\Profiles\\Profile1")).await?;
println!("[INFO]: the session is launched on port [54477] ..");
session.open("https://vk.com/otaku_lounge?w=wall-230618027_38").await?;
println!("[INFO]: loaded page url 'https://vk.com/otaku_lounge?w=wall-230618027_38'");
sleep(Duration::from_secs(1)).await;
match script(&session).await {
Ok(_) => println!("[INFO] Script is successfully executed!"),
Err(e) => eprintln!("[INFO] Executing script error: {e}"),
}
sleep(Duration::from_secs(2)).await;
session.close().await?;
println!("[INFO]: the session is closed");
Ok(())
}
async fn script(session: &Session) -> Result<()> {
session.click(r#"div[aria-label="Отправить реакцию «Лайк»"]"#).await?;
Ok(())
}
Licensing:
Distributed under the MIT license.
Feedback:
You can contact me via GitHub or send a message to my Telegram @fuderis.
This library is constantly evolving, and I welcome your suggestions and feedback.