mirror of
https://github.com/kennethreitz/requests-html.git
synced 2026-06-05 23:00:20 +00:00
+1
-1
@@ -449,8 +449,8 @@ def user_agent(style=None) -> _UserAgent:
|
||||
"""Returns a random user-agent, if not requested one of a specific
|
||||
style. Defaults to a Chrome-style User-Agent.
|
||||
"""
|
||||
global useragent
|
||||
if (not useragent) and style:
|
||||
global useragent
|
||||
useragent = UserAgent()
|
||||
|
||||
return useragent[style] if style else DEFAULT_USER_AGENT
|
||||
|
||||
Reference in New Issue
Block a user