1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! This crate allows you to control a web browser (Firefox or chrome) easily. 
//! It does not use selenium, which is much more lightweight.
//! It only uses geckodriver or chromedriver (you have to download the one you want to use depending on your browser and place it in your program's directory).
//! This crate can launch the driver and kill his process after, but if one is already running, it will be used.  
//! A lot of improvements can be done. Feel free to contribute.
//! 
//! # Example
//! 
//! ```rust
//! use lw_webdriver::{session::Session, enums::{Browser, Selector}};
//! use std::{thread, time::Duration};
//!
//! // start session
//! let session = Session::new(Browser::Firefox, false).unwrap();
//!
//! // load a website
//! let mut tab = session.get_selected_tab().unwrap();
//! tab.navigate("https://mubelotix.dev/").unwrap();
//!
//! // click a link
//! let mut link = tab.find(Selector::XPath, "//a[@href='https://www.kerbalspaceprogram.com/']").unwrap().unwrap();
//! link.click().unwrap();
//!
//! thread::sleep(Duration::from_secs(5));
//! ```

pub mod session;
pub mod enums;
pub mod tab;
pub mod elements;
pub mod timeouts;
pub mod error;