selenium_rs/lib.rs
1/*!
2 This library provides a client API for the selenium webdriver specification:
3 [](https://www.w3.org/TR/webdriver1/)
4
5 #Usage
6
7 ```toml
8 [dependencies]
9 selenium-rs = "0.1"
10 ```
11
12 and add this to your root crate:
13 ```rust
14 extern crate selenium_rs;
15 ```
16
17
18 ## Requirements
19
20 Selenium-rs requires that there is an instance of the selenium-webdriver server running
21 to make requests against.
22
23 As of right now the easiest way to get this is to download the standalone from:
24 [https://www.seleniumhq.org/download/], and then running it (requires Java 1.8+)
25
26
27 # Example: Make a google search, programmatically
28
29 ```rust
30 use selenium_rs::webdriver::{Browser, WebDriver, Selector};
31
32 let mut driver = WebDriver::new(Browser::Chrome);
33 driver.start_session();
34 driver.navigate("http://google.com");
35 let search_bar = driver.find_element(Selector::CSS, "input[maxlength=\"2048\"]").unwrap();
36 search_bar.type_text("selenium-rs github");
37 let search_button = driver.find_element(Selector::CSS, "input[name=\"btnK\"]").unwrap();
38
39 search_button.click();
40 ```
41*/
42
43extern crate reqwest;
44extern crate url;
45
46#[macro_use]
47extern crate serde_derive;
48extern crate serde;
49extern crate serde_json;
50
51pub mod element;
52pub mod webdriver;
53
54mod element_structs;
55mod session_structs;
56mod utils;