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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*!
This library provides a client API for the selenium webdriver specification:
[](https://www.w3.org/TR/webdriver1/)
#Usage
```toml
[dependencies]
selenium_rs = "0.1"
```
and add this to your root crate:
```rust
extern crate selenium_rs;
```
## Requirements
Selenium-rs requires that there is an instance of the selenium-webdriver server running
to make requests against.
As of right now the easiest way to get this is to download the standalone from:
[https://www.seleniumhq.org/download/], and then running it (requires Java 1.8+)
# Example: Make a google search, programmatically
```rust
use selenium_rs::webdriver::{Browser, WebDriver, Selector};
let mut driver = WebDriver::new(Browser::Chrome);
driver.start_session();
driver.navigate("http://google.com");
let search_bar = driver.query_element(Selector::CSS, ".gLFyf").unwrap();
search_bar.type_text("selenium-rs github");
let search_button = driver.query_element(Selector::CSS, "#gbqfbb").unwrap();
search_button.click();
```
*/
extern crate reqwest;
extern crate url;
extern crate serde_derive;
extern crate serde;
extern crate serde_json;