惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
Recorded Future
Recorded Future
S
Schneier on Security
I
InfoQ
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
O
OpenAI News
W
WeLiveSecurity
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
人人都是产品经理
人人都是产品经理
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
The Hacker News
The Hacker News
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
NISL@THU
NISL@THU
T
Tailwind CSS Blog
V
Visual Studio Blog
PCI Perspectives
PCI Perspectives
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
D
DataBreaches.Net
B
Blog RSS Feed
N
News and Events Feed by Topic
N
News and Events Feed by Topic
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
Latest news
Latest news
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
V
V2EX
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
Help Net Security
Help Net Security

Kevin's Blog

逆向工程之IP-COM M50-F telnet 密码破解 - 逆向工程 又一个很久没更新了 - 文章 - Kevin's Blog 评测 - 可能是马来西亚第一个中文Starlink测试 - 文章 很久没更新了 - 文章 - Kevin's Blog 网络安全解析:你家的真的网络安全吗? - 文章 - Kevin's Blog 维修门店的诡计与顾客权益的Battle - 文章 - Kevin's Blog 疑似不易之财?! - 文章 - Kevin's Blog 大学的生活,我准备好了吗? - 文章 - Kevin's Blog 被Cloudflare ban的惨痛经历 - 文章 - Kevin's Blog
robots.txt是什么,它有什么用处 - 知识点 - Kevin's Blog
2023-03-06 · via Kevin's Blog

robots.txt

robots.txt是一个用于网站管理的文本文件,其目的是告诉搜索引擎哪些页面可以被抓取和索引,以及哪些页面不应被抓取。此文件通常位于网站的根目录下,并由网络管理员创建和维护。搜索引擎的爬虫在抓取网站内容之前会先查看此文件,以确定哪些页面是可以抓取的。


在了解robots.txt是怎么运作之前,我们先看看robots.txt是怎么运作的吧!

# robots.txt file for YouTube
# Created in the distant future (the year 2000) after
# the robotic uprising of the mid 90's which wiped out all humans.

User-agent: Mediapartners-Google*
Disallow:

User-agent: *
Disallow: /comment
Disallow: /get_video
Disallow: /get_video_info
Disallow: /get_midroll_info
Disallow: /live_chat
Disallow: /login
Disallow: /results
Disallow: /signup
Disallow: /t/terms
Disallow: /timedtext_video
Disallow: /verify_age
Disallow: /watch_ajax
Disallow: /watch_fragments_ajax
Disallow: /watch_popup
Disallow: /watch_queue_ajax

Sitemap: https://www.youtube.com/sitemaps/sitemap.xml
Sitemap: https://www.youtube.com/product/sitemap.xml

以上的都来自美国科技公司Youtube

我们可以注意到robots.txt可以分为几个部分,分别是 User-agent, Disallow, Allow, 以及 Sitemap四个大项。

  • User-agent: 搜索引擎爬虫的名称。通过指定不同的user-agent,可以告诉搜索引擎不同的规则。例如,可以为Googlebot和Bingbot分别指定不同的规则。
  • Allow: 允许搜索引擎抓取并索引的页面列表。可以在这里指定一个页面,也可以使用通配符(*)来指定多个页面。
  • Disallow: 不允许搜索引擎抓取和索引的页面列表。同样可以指定具体页面或使用通配符。
  • Sitemap:是一个XML文件,包含了网站中所有页面的列表,以及有关每个页面的其他信息。这些信息包括页面的最后修改日期、页面更改的频率和优先级等。Sitemap可用于向搜索引擎提供关于网站结构和页面内容的信息,从而更好地优化搜索引擎爬虫的索引过程。

在2013年,百度因为泄露用户隐私而遭受严重批评,此丑闻被称为“百度门”事件。具体来说,百度的搜索引擎被指控忽略了网站的robots.txt文件,从而抓取了用户标记为私有的页面。这些页面包括了用户的真实姓名、地址、电话号码、身份证号码等敏感信息,其中一些信息还被公开在搜索结果页面上。

这个丑闻首先由北京大学法学院教授管延静在微博上曝光,随后引起了广泛的媒体和舆论关注。许多人批评百度的做法是违反了用户隐私的基本原则,严重影响了用户的信任。还有人指出,百度这种做法违反了搜索引擎的基本规则,即尊重网站的robots.txt文件,而这个文件是网站所有者用来控制搜索引擎访问自己网站的重要手段。

在这个事件发生后,百度迅速发布了一份道歉信,承认错误并保证将采取措施改善其隐私保护措施。此外,百度还宣布成立了一个专门的工作组来检查其隐私保护措施,并对所有受影响的用户提供了免费的身份保护服务。然而,这个事件对百度的声誉造成了严重的损害,并引发了对中国互联网公司隐私保护能力的广泛担忧。

所以互联网不是法外之地,虽然爬虫机器人的到来为我们提供了触手可得的的资讯,但不是坏人用来滥用,并且损害他人利益的武器。