2 unstable releases
0.2.0 | Jun 3, 2024 |
---|---|
0.1.1 | Mar 10, 2024 |
0.1.0 |
|
#54 in #tauri
296 downloads per month
17KB
349 lines
Tauri Plugin fanto
Fantoccini integrated with webdriver downloader
Install
src-tauri/Cargo.toml
[dependencies]
tauri-plugin-fanto = "0.2.0"
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
~28–73MB
~1M SLoC