经济日报
尤其需要注意 BaiduAI-Spider ,这个标识是百度大模型训练爬虫的典型代表,若不加入白名单,未来可能影响网站内容在百度AI生态中的曝光
d/ 或 /etc/nginx/sites-enabled/ )的 server 块或 location 块中添加以下判断: if ($http_user_agent🎊 ~* (Baiduspider|BaiduAI-Spider)) { set $allo📌w_baidu 1; } # 对其他爬虫做限制,仅放行百度系列 if ($allow_baidu
conf 中,可以使用 RewriteCond 和 RewriteRule 组合实现🚀: RewriteEngine On RewriteCond %{HTTP_USER_AGENT}
0 (compatible🔍; B⭐aiduspider/2
在实际操作中,建议建立 「最小必要」 原则:仅放行确有数据需求的合法爬虫,对来源不明的爬虫一律拒绝
Baiduspider-render🍀 ——用于渲染JavaScript内容的爬虫,对现代单页应用网站尤为重要
以下是常见的几种方案: Nginx环境 在网站配置文件(通常位于 /etc/n✨gi📢nx/conf
= 1) { return 403; } 以上配置能确保只有UA中包含“Baiduspider”或“BaiduAI-Spider”的请求才能正常访问,其他爬虫将被自动拦截