<dependency> <groupId>eu.bitwalker</groupId> <artifactId>UserAgentUtils</artifactId> <version>1.21</version> </dependency>
import eu.bitwalker.useragentutils.Browser; import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.Version; Browser browser = UserAgent.parseUserAgentString(request.getHeader("User-Agent")).getBrowser(); Version version = browser.getVersion(request.getHeader("User-Agent")); logger.info("获取浏览器名称:{},获取浏览器版本:{}",browser.getName(), version.getVersion());