DynamicUserAgentManager class

A manager for dynamically fetching and using user agents

Constructors

DynamicUserAgentManager.new({List<String>? initialUserAgents, Random? random, ScrapingLogger? logger})
Creates a new DynamicUserAgentManager

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addSiteSpecificUserAgent(String domain, String userAgent) → void
Adds a site-specific user agent
addUserAgent(String userAgent) → void
Adds a user agent to the list
getRandomUserAgent() String
Gets a random user agent
getRandomUserAgentForSite(String url) String
Gets a random user agent for a specific site
getSiteSpecificUserAgents(String domain) List<String>
Gets the site-specific user agents for a domain
getUserAgentByType(BrowserType type) String
Gets a user agent that mimics a specific browser
getUserAgents() List<String>
Gets the list of user agents
getUserAgentSequenceForProblematicSite(String url) List<String>
Gets a sequence of user agents to try for a problematic site
initialize() Future<void>
Initializes the manager by fetching user agents from the web
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited