Answer the question
In order to leave comments, you need to log in
How to identify a bot by User-agent?
How to identify a bot by User-agent?
Pen is interested in any bots - search engines, from social networks, in short - not real people.
How to determine them by User-Agent?
Let's say they don't change the User-agent to "normal".
if anything - I need to sort the logs
Answer the question
In order to leave comments, you need to log in
So far I have this code:
if(strlen($useragent)<75){
$isbot = 'BOT';
}else if(strlen($useragent)>100){
$isbot = 'USER';
}else{
$isbot = 'ХЗ, '.strlen($useragent);
}
You can reliably determine only by IP or you need to connect JavaScript and watch the behavior
well, in their user agent it is written what kind of bot they are, take it and sort it
Implementation with a small function in php
https://youtu.be/Dz-eDdHs4m8
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question