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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! A high-level API for programmatically interacting with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/).
//!
//! This crate uses the [Chrome DevTools protocol] to drive/launch a Chromium or
//! Chrome (potentially headless) browser.
//!
//! # Example
//! ```no_run
//! use futures_util::StreamExt;
//! use chromiumoxide::{Browser, BrowserConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!
//! let (browser, mut handler) =
//! Browser::launch(BrowserConfig::builder().with_head().build()?).await?;
//!
//! let handle = tokio::task::spawn(async move {
//! loop {
//! let _event = handler.next().await.unwrap();
//! }
//! });
//!
//! let page = browser.new_page("https://en.wikipedia.org").await?;
//!
//! // type into the search field and hit `Enter`,
//! // this triggers a navigation to the search result page
//! page.find_element("input#searchInput")
//! .await?
//! .click()
//! .await?
//! .type_str("Rust programming language")
//! .await?
//! .press_key("Enter")
//! .await?;
//!
//! let html = page.wait_for_navigation().await?.content().await?;
//!
//! let _ = handle.await;
//! Ok(())
//! }
//! ```
//!
//! The [`chromiumoxide_pdl`] crate contains a [PDL
//! parser](chromiumoxide_pdl/src/pdl/parser.rs), which is a rust rewrite of a
//! [python script in the chromium source tree]( https://chromium.googlesource.com/deps/inspector_protocol/+/refs/heads/master/pdl.py) and a
//! [`Generator`](chromiumoxide_pdl/src/build/generator.rs) that turns the
//! parsed PDL files into rust code. The
//! [`chromiumoxide_cdp`](chromiumoxide_cdp) crate only purpose is to integrate
//! the generator during is build process and include the generated output
//! before compiling the crate itself. This separation is done merely because
//! the generated output is ~60K lines of rust code (not including all the Proc
//! macro extensions). So expect the compilation to take some time.
//!
//! The generator can be configured and used independently, see [`build.rs`] of
//! [`chromiumoxide_cdp`].
//!
//! [chromedp](https://github.com/chromedp/chromedp)
//! [rust-headless-chrome](https://github.com/Edu4rdSHL/rust-headless-chrome) which the launch
//! config, `KeyDefinition` and typing support is taken from.
//! [puppeteer](https://github.com/puppeteer/puppeteer)
pub
use crateHttpRequest;
use Arc;
/// re-export fingerprint management.
pub use spider_fingerprint;
/// re-export network blocker.
pub use spider_network_blocker;
/// re-export firewall.
pub use spider_firewall;
pub use crate;
pub use crateConnection;
pub use crateElement;
pub use crateResult;
pub use crate;
pub use crateactive_page_count;
pub use crateHandler;
pub use cratePage;
/// re-export the generated cdp types
pub use cdp;
pub use ;
/// HTTP request.
pub type ArcHttpRequest = ;
pub use serde;
pub use serde_json;
pub use sonic_rs as serde_json;
/// Init the cache global worker.
pub use init_default_cache_worker;