mirror of
https://github.com/daijro/camoufox.git
synced 2026-08-18 16:00:58 +00:00
d6540b52ce
* example files * contributing guides * simple service test * run tests in sync * update pr template * pip updates * Update README.md * typo fixes * undo pip package update lol * upgraded service test * undo injections * test with proxies * auto set timezone and proxy url * delete checks bundle * split up service tests * split up build tests * rename service tests to service tester * Update CONTRIBUTING.md * fix entry vs exit ip * allow alpha versions * fix patch issues on macos * bidirectional patch * Add note on experimental pip package
33 lines
911 B
Python
33 lines
911 B
Python
"""
|
|
Quick example to test cloverlabs-camoufox.
|
|
|
|
Install deps:
|
|
pip install cloverlabs-camoufox
|
|
python -m camoufox fetch
|
|
"""
|
|
|
|
from camoufox.sync_api import Camoufox
|
|
|
|
with Camoufox(headless=False) as browser:
|
|
page = browser.new_page()
|
|
|
|
# Visit a fingerprint test page
|
|
page.goto("https://abrahamjuliot.github.io/creepjs/")
|
|
page.wait_for_load_state("networkidle", timeout=30_000)
|
|
|
|
title = page.title()
|
|
print(f"Page title: {title}")
|
|
|
|
# Grab the trust score CreepJS assigns
|
|
score_el = page.query_selector("#creep-results .grade")
|
|
if score_el:
|
|
print(f"CreepJS trust grade: {score_el.inner_text()}")
|
|
else:
|
|
print("Score element not found — page may still be loading.")
|
|
|
|
# Print the spoofed user-agent the browser reported
|
|
ua = page.evaluate("navigator.userAgent")
|
|
print(f"User-Agent: {ua}")
|
|
|
|
input("\nPress Enter to close the browser...")
|