#tauri-plugin #tauri #plugin #selenium #fantoccini #webdriver-downloader

sys tauri-plugin-fanto

tauri plugin fantoccini integrated with webdriver-downloader

1 unstable release

0.1.1 Mar 10, 2024
0.1.0 Mar 9, 2024

#4 in #selenium

Download history 242/week @ 2024-03-08 27/week @ 2024-03-15 8/week @ 2024-03-22 22/week @ 2024-03-29 121/week @ 2024-04-05

185 downloads per month

MIT/Apache

15KB
319 lines

Tauri Plugin fanto

Fantoccini integrated with webdriver downloader

Install

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-fanto = "0.1.1"

Usage

src-tauri/src/main.rs

use tauri::AppHandle;
use tauri_plugin_fanto::{
    FantoExt,
    fantoccini::{
        Locator,
        key::Key,
    },
    Error,
};

#[tauri::command]
async fn greet(app: tauri::AppHandle) -> Result<(), Error> {
    let fanto = app.fanto();

    let driver = fanto.driver().await?;

    driver.goto("https://www.example.com").await?;
    driver.find(Locator::XPath("//a")).await?
        .click().await?;

    Ok(())
}

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_fanto::init())
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Dependencies

~27–73MB
~1M SLoC