the user agent can be judged by the navigator object of BOM
navigator.userAgent
my browser returns
"" Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 ""
is it possible to detect whether it is a Baidu spider or other spiders?
New version of Mobile ua:
Mozilla/5.0 (Linux;u;Android 4.2.2)
AppleWebKit/534.46 (KHTML,like Gecko) Version/5.1 Mobile Safari/10600.6.3
(compatible; Baiduspider/2.0; + ider.html" rel=" nofollow noreferrer "> http://www.baidu.com/search/s.)
PC ua:
Mozilla/5.0 (compatible; Baiduspider/2.0;) + ider.html" rel=" nofollow noreferrer "> http://www.baidu.com/search/s.)