Skip to content

Commit

Permalink
Added wrapper around user agent within selenium module, thanks to #575
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTruncer committed Jul 13, 2022
1 parent 2e7b880 commit 80c5379
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Python/modules/selenium_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,13 @@ def capture_host(cli_parsed, http_object, driver, ua=None):
context = None
pass

try:
tempua = driver.execute_script("return navigator.userAgent")
except:
tempua = ''
if cli_parsed.user_agent:
tempua = cli_parsed.user_agent
else:
try:
tempua = driver.execute_script("return navigator.userAgent")
except:
tempua = ''
try:
req = urllib.request.Request(http_object.remote_system, headers={'User-Agent': tempua})
if cli_parsed.proxy_ip is not None:
Expand Down

0 comments on commit 80c5379

Please sign in to comment.