Expand description
§cloudscraper-rs
A Rust-first take on Cloudflare challenge solving inspired by the classic Python Cloudscraper.
The crate is still early-stage. Expect rough edges while the detection pipeline, adaptive modules, and captcha integrations continue to evolve.
§Features
- Fast and efficient async HTTP client
- Support for Cloudflare v1, v2, v3, and Turnstile challenges
- Browser fingerprinting and User-Agent rotation
- Automatic proxy rotation
- Stealth mode with human-like behavior
- Custom TLS cipher suites
- Automatic cookie management
§Example
use cloudscraper_rs::CloudScraper;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let scraper = CloudScraper::new()?;
let response = scraper.get("https://example.com").await?;
println!("Response: {}", response.text().await?);
Ok(())
}Re-exports§
pub use crate::challenges::core::ChallengeExecutionError;pub use crate::challenges::core::ChallengeHttpClient;pub use crate::challenges::core::ChallengeHttpClientError;pub use crate::challenges::core::ChallengeHttpResponse;pub use crate::challenges::core::ChallengeResponse;pub use crate::challenges::core::ChallengeSubmission;pub use crate::challenges::core::OriginalRequest;pub use crate::challenges::core::ReqwestChallengeHttpClient;pub use crate::challenges::core::execute_challenge_submission;pub use crate::challenges::detectors::ChallengeDetection;pub use crate::challenges::detectors::ChallengeDetector;pub use crate::challenges::detectors::ChallengeType;pub use crate::challenges::detectors::ResponseStrategy;pub use crate::challenges::pipeline::ChallengePipeline;pub use crate::challenges::pipeline::ChallengePipelineResult;pub use crate::challenges::pipeline::PipelineContext;pub use crate::challenges::pipeline::PipelineError;pub use crate::challenges::pipeline::UnsupportedReason;pub use crate::challenges::solvers::FailureRecorder;pub use crate::challenges::solvers::FingerprintManager;pub use crate::challenges::solvers::MitigationPlan;pub use crate::challenges::solvers::TlsProfileManager;pub use crate::challenges::user_agents::UserAgentError;pub use crate::challenges::user_agents::UserAgentOptions;pub use crate::challenges::user_agents::UserAgentProfile;pub use crate::challenges::user_agents::get_user_agent_profile;pub use crate::external_deps::captcha::AntiCaptchaProvider;pub use crate::external_deps::captcha::CapSolverProvider;pub use crate::external_deps::captcha::CaptchaConfig;pub use crate::external_deps::captcha::CaptchaError;pub use crate::external_deps::captcha::CaptchaProvider;pub use crate::external_deps::captcha::CaptchaResult;pub use crate::external_deps::captcha::CaptchaSolution;pub use crate::external_deps::captcha::CaptchaTask;pub use crate::external_deps::captcha::TwoCaptchaProvider;pub use crate::external_deps::interpreters::BoaJavascriptInterpreter;pub use crate::external_deps::interpreters::InterpreterError;pub use crate::external_deps::interpreters::InterpreterResult;pub use crate::external_deps::interpreters::JavascriptInterpreter;pub use crate::modules::AdaptiveTimingStrategy;pub use crate::modules::AntiDetectionContext;pub use crate::modules::AntiDetectionStrategy;pub use crate::modules::BehaviorProfile;pub use crate::modules::BrowserFingerprint;pub use crate::modules::BrowserProfile;pub use crate::modules::BrowserType;pub use crate::modules::ChallengeEvent;pub use crate::modules::ConsistencyLevel;pub use crate::modules::DefaultAdaptiveTiming;pub use crate::modules::DefaultAntiDetection;pub use crate::modules::DefaultTLSManager;pub use crate::modules::DomainState;pub use crate::modules::DomainStats;pub use crate::modules::DomainTimingSnapshot;pub use crate::modules::ErrorEvent;pub use crate::modules::EventDispatcher;pub use crate::modules::EventHandler;pub use crate::modules::FeatureVector;pub use crate::modules::FingerprintGenerator;pub use crate::modules::GlobalStats;pub use crate::modules::LoggingHandler;pub use crate::modules::MLOptimizer;pub use crate::modules::MetricsCollector;pub use crate::modules::MetricsHandler;pub use crate::modules::MetricsSnapshot;pub use crate::modules::PerformanceConfig;pub use crate::modules::PerformanceMonitor;pub use crate::modules::PerformanceReport;pub use crate::modules::PostResponseEvent;pub use crate::modules::PreRequestEvent;pub use crate::modules::ProxyConfig;pub use crate::modules::ProxyHealthReport;pub use crate::modules::ProxyManager;pub use crate::modules::RequestKind;pub use crate::modules::RetryEvent;pub use crate::modules::RotationStrategy;pub use crate::modules::ScraperEvent;pub use crate::modules::StateManager;pub use crate::modules::StrategyRecommendation;pub use crate::modules::TLSConfig;pub use crate::modules::TimingOutcome;pub use crate::modules::TimingRequest;
Modules§
- challenges
- external_
deps - Integrations that rely on third-party services.
- modules
- Cross-cutting services module
Structs§
- Cloud
Scraper - Main scraper orchestrator.
- Cloud
Scraper Builder - Fluent builder for
CloudScraper. - Cloud
Scraper Config - Scraper configuration used by the builder.
- Scraper
Response - Read-only HTTP response returned by the scraper.
Enums§
- Cloud
Scraper Error - High-level error surfaced by the orchestrator.
Constants§
- VERSION
- Library version
Type Aliases§
- Cloud
Scraper Result - Result alias used across the orchestration layer.