How to detect fake users ( crawlers ) and cURL

前端 未结 6 907
-上瘾入骨i
-上瘾入骨i 2020-12-02 04:12

Some other website use cURL and fake http referer to copy my website content. Do we have any way to detect cURL or not real web browser ?

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 04:40

    As some have mentioned cURL cannot execute JavaScritp (to my knowledge) so you could possibly try setting someting up like raina77ow suggest but that would not wokrk for other grabbers/donwloaders.

    I suggest you try building a bot trap that way you deal with the grabbers/downloaders that can execute JavaScript.

    I don't know of any 1 solution to fully prevent this, so my best recommendation would be to try multiple solutions:

    1) only allow known user agents such as all mainstream browsers in your .htaccess file

    2) Set up your robots.txt to prevent bots

    3) Set up a bot trap for bots that do not respect the robots.txt file

提交回复
热议问题