def get_browser(user_agent):
 match = re.search('(?i)(firefox|msie|chrome|safari|trident)', user_agent, re.IGNORECASE)
 if match:
  browser = match.group(1)
 else:
  browser = None
 return browser

def get_browser ( user_agent ) : match = re . search ( '(?i)(firefox|msie|chrome|safari|trident)' , user_agent , re . IGNORECASE ) if match : browser = match . group ( 1 ) else : browser = None return browser
get browser name from user agent .