pub enum Impersonate {
None,
Single(String),
Random(Vec<String>),
}Expand description
Browser impersonation strategy for TLS/HTTP fingerprinting.
Modern bot-detection services fingerprint the TLS ClientHello and HTTP/2 settings
to distinguish real browsers from HTTP libraries. This enum controls which browser
profile the underlying wreq client emulates. The default is Single("chrome").
Variants§
None
No browser impersonation. The client uses wreq’s default TLS settings, which may be detected as non-browser traffic by sophisticated bot-detection systems.
Single(String)
Impersonate a single specific browser profile for all requests. Pass a string
like "chrome", "firefox", or "safari" (see client::resolve_emulation
for the full list of supported names).
Random(Vec<String>)
Randomly select from a list of browser profiles on each request. This adds diversity to your fingerprint, which can help avoid detection when scraping at scale.
Implementations§
Source§impl Impersonate
impl Impersonate
Sourcepub fn select(&self) -> Option<&str>
pub fn select(&self) -> Option<&str>
Returns the browser profile name to use for the current request, or None
if impersonation is disabled.
For Impersonate::Random, a new profile is selected each time this method
is called, so consecutive calls may return different values.
Trait Implementations§
Source§impl Clone for Impersonate
impl Clone for Impersonate
Source§fn clone(&self) -> Impersonate
fn clone(&self) -> Impersonate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Impersonate
impl Debug for Impersonate
Auto Trait Implementations§
impl Freeze for Impersonate
impl RefUnwindSafe for Impersonate
impl Send for Impersonate
impl Sync for Impersonate
impl Unpin for Impersonate
impl UnsafeUnpin for Impersonate
impl UnwindSafe for Impersonate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more