From e509dff888eed750c6bfb88752e990981399702a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 1 Mar 2018 12:53:04 -0500 Subject: [PATCH] fixes Signed-off-by: Kenneth Reitz --- requests_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_html.py b/requests_html.py index 32145a3..f88396e 100644 --- a/requests_html.py +++ b/requests_html.py @@ -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