browser_oxide 0.1.3

Stealth headless browser engine in Rust: real HTML/CSS/DOM/JS, V8 via deno_core, own BoringSSL TLS/JA4 fingerprint, no Chromium, no CDP — for anti-bot web scraping, archival, and AI agents
Documentation
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
//! Deep-path validation (Option A) — probe product/search/detail pages on
//! the 48 sites that land at L3 to test whether the landing pass translates
//! to real scraping capability, or if it was just a landing-page grace period.
//!
//! Some bot-detection sensors build trust profiles over the first 5-10
//! requests before scoring. A single GET doesn't exercise that. This
//! suite makes N=2 requests per site (landing then a deep path) to see
//! if the trust profile holds.
//!
//! Run: cargo test -p browser --test deep_path_validation \
//!          -- --ignored --test-threads=1 --nocapture
//!
//! Each test prints [L1 L2 L3] for both the landing and the deep path so
//! we can see if the deep path stays green or degrades.

#[allow(
    dead_code,
    reason = "diagnostic capture struct; not all fields are asserted"
)]
struct DeepProbeResult {
    site: String,
    landing_url: String,
    landing_status: u16,
    landing_l3: bool,
    deep_url: String,
    deep_status: u16,
    deep_l3: bool,
    notes: String,
}

impl DeepProbeResult {
    fn print(&self) {
        let landing = if self.landing_l3 { "L3" } else { "-" };
        let deep = if self.deep_l3 { "L3" } else { "-" };
        let verdict = match (self.landing_l3, self.deep_l3) {
            (true, true) => "HOLD",
            (true, false) => "DEGRADE",
            (false, true) => "weird",
            (false, false) => "both-fail",
        };
        println!(
            "[{verdict:<7}] {site:<30} landing={landing} ({ls}) deep={deep} ({ds})",
            site = self.site,
            ls = self.landing_status,
            ds = self.deep_status,
        );
        if !self.notes.is_empty() {
            println!("           {}", self.notes);
        }
    }
}

async fn deep_probe(
    site: &str,
    landing: &str,
    deep: &str,
    profile: browser_oxide::stealth::StealthProfile,
    deep_markers: &[&str],
    deep_negative: &[&str],
) -> DeepProbeResult {
    let client = browser_oxide::net::HttpClient::new(&profile).unwrap();

    // Landing
    let landing_resp = match client.get_follow(landing, 10).await {
        Ok(r) => r,
        Err(e) => {
            return DeepProbeResult {
                site: site.into(),
                landing_url: landing.into(),
                landing_status: 0,
                landing_l3: false,
                deep_url: deep.into(),
                deep_status: 0,
                deep_l3: false,
                notes: format!("landing err: {e}"),
            };
        }
    };
    let landing_status = landing_resp.status;
    let landing_ok = matches!(landing_status, 200 | 202 | 301 | 302);

    // Deep
    let deep_resp = match client.get_follow(deep, 10).await {
        Ok(r) => r,
        Err(e) => {
            return DeepProbeResult {
                site: site.into(),
                landing_url: landing.into(),
                landing_status,
                landing_l3: landing_ok,
                deep_url: deep.into(),
                deep_status: 0,
                deep_l3: false,
                notes: format!("deep err: {e}"),
            };
        }
    };
    let deep_status = deep_resp.status;
    let deep_ok_status = matches!(deep_status, 200 | 202 | 301 | 302);
    let body = deep_resp.text();
    let mut deep_l3 = deep_ok_status;
    let mut reason = String::new();
    if deep_l3 {
        for m in deep_markers {
            if !body.contains(m) {
                deep_l3 = false;
                reason = format!("missing marker '{m}'");
                break;
            }
        }
    } else {
        reason = format!("status {deep_status}");
    }
    if deep_l3 {
        for m in deep_negative {
            if body.contains(m) {
                deep_l3 = false;
                reason = format!("hit negative '{m}'");
                break;
            }
        }
    }

    DeepProbeResult {
        site: site.into(),
        landing_url: landing.into(),
        landing_status,
        landing_l3: landing_ok,
        deep_url: deep.into(),
        deep_status,
        deep_l3,
        notes: reason,
    }
}

// ================================================================
// Deep probes — one per site, two requests each (landing + deep path)
// ================================================================

#[tokio::test]
#[ignore]
async fn deep_amazon_dp() {
    // A specific Amazon product detail URL (Kindle).
    let r = deep_probe(
        "amazon.com",
        "https://www.amazon.com/",
        "https://www.amazon.com/dp/B08N3TCP5Z",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["validateCaptcha", "Sorry, we just need"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_chatgpt_about() {
    let r = deep_probe(
        "chatgpt.com",
        "https://chatgpt.com/",
        "https://chatgpt.com/auth/login",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Just a moment"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_linkedin_feed() {
    let r = deep_probe(
        "linkedin.com",
        "https://www.linkedin.com/",
        "https://www.linkedin.com/feed/",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Access denied", "Pardon Our Interruption"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_coinbase_price() {
    let r = deep_probe(
        "coinbase.com",
        "https://www.coinbase.com/",
        "https://www.coinbase.com/price/bitcoin",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html", "Bitcoin"],
        &["Just a moment"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_medium_topics() {
    let r = deep_probe(
        "medium.com",
        "https://medium.com/",
        "https://medium.com/topic/technology",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Just a moment"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_discord_developers() {
    let r = deep_probe(
        "discord.com",
        "https://discord.com/",
        "https://discord.com/developers/docs/intro",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Just a moment"],
    )
    .await;
    r.print();
}

// --- Tier 0.5 deep paths ---

#[tokio::test]
#[ignore]
async fn deep_product_page() {
    // Nike Air Max — a specific product detail URL
    let r = deep_probe(
        "nike.com",
        "https://www.nike.com/",
        "https://www.nike.com/w/mens-shoes-nik1zy7ok",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Access Denied", "Pardon Our Interruption"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_search_page() {
    let r = deep_probe(
        "walmart.com",
        "https://www.walmart.com/",
        "https://www.walmart.com/search?q=laptop",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Robot or human", "Access Denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_zillow_search() {
    let r = deep_probe(
        "zillow.com",
        "https://www.zillow.com/",
        "https://www.zillow.com/homes/San-Francisco_rb/",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Robot", "Access Denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_stockx_browse() {
    let r = deep_probe(
        "stockx.com",
        "https://www.stockx.com/",
        "https://stockx.com/sneakers",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Access denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_glassdoor_jobs() {
    let r = deep_probe(
        "glassdoor.com",
        "https://www.glassdoor.com/",
        "https://www.glassdoor.com/Job/jobs.htm?sc.keyword=software%20engineer",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &[r#"dd={"rt""#, "ct.captcha-delivery.com"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_crunchbase_search() {
    let r = deep_probe(
        "crunchbase.com",
        "https://www.crunchbase.com/",
        "https://www.crunchbase.com/discover/organization.companies",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &[r#"dd={"rt""#],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_reddit_sub() {
    let r = deep_probe(
        "reddit.com",
        "https://www.reddit.com/",
        "https://www.reddit.com/r/rust/",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &[r#"dd={"rt""#, "Access denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_delta_destinations() {
    let r = deep_probe(
        "delta.com",
        "https://www.delta.com/",
        "https://www.delta.com/flight-search/book-a-flight",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Access Denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_turbotax_products() {
    let r = deep_probe(
        "turbotax.com",
        "https://turbotax.intuit.com/",
        "https://turbotax.intuit.com/personal-taxes/online/",
        browser_oxide::stealth::chrome_148_windows(),
        &["<html"],
        &["Access Denied"],
    )
    .await;
    r.print();
}

// --- CN deep paths ---

#[tokio::test]
#[ignore]
async fn deep_taobao_search() {
    let r = deep_probe(
        "taobao.com",
        "https://www.taobao.com/",
        "https://s.taobao.com/search?q=laptop",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &[r#""code":"punish""#, "slider"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_tmall_search() {
    let r = deep_probe(
        "tmall.com",
        "https://www.tmall.com/",
        "https://list.tmall.com/search_product.htm?q=laptop",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &[r#""code":"punish""#, "slider"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_jd_search() {
    let r = deep_probe(
        "jd.com",
        "https://www.jd.com/",
        "https://search.jd.com/Search?keyword=laptop",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &["access denied"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_baidu_search() {
    let r = deep_probe(
        "baidu.com",
        "https://www.baidu.com/",
        "https://www.baidu.com/s?wd=rust",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &["百度安全验证"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_douyin_explore() {
    let r = deep_probe(
        "douyin.com",
        "https://www.douyin.com/",
        "https://www.douyin.com/discover",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &[],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_bilibili_play() {
    let r = deep_probe(
        "bilibili.com",
        "https://www.bilibili.com/",
        "https://www.bilibili.com/v/popular/all",
        browser_oxide::stealth::presets::chrome_148_cn(),
        &["<html"],
        &[],
    )
    .await;
    r.print();
}

// --- RU deep paths ---

#[tokio::test]
#[ignore]
async fn deep_avito_search() {
    let r = deep_probe(
        "avito.ru",
        "https://www.avito.ru/",
        "https://www.avito.ru/moskva?q=iphone",
        browser_oxide::stealth::presets::chrome_148_ru(),
        &["<html"],
        &["Доступ ограничен"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_ya_search() {
    let r = deep_probe(
        "ya.ru",
        "https://ya.ru/",
        "https://ya.ru/search/?text=rust%20language",
        browser_oxide::stealth::presets::chrome_148_ru(),
        &["<html"],
        &["showcaptcha"],
    )
    .await;
    r.print();
}

#[tokio::test]
#[ignore]
async fn deep_vk_feed() {
    let r = deep_probe(
        "vk.com",
        "https://vk.com/",
        "https://vk.com/feed",
        browser_oxide::stealth::presets::chrome_148_ru(),
        &["<html"],
        &["Доступ ограничен"],
    )
    .await;
    r.print();
}