2022年8月14日robots.txt 文件主要用于管理流向网站的抓取工具流量,通常用于阻止 Google 访问某个文件(具体取决于文件类型)。 如果您使用 robots.txt 文件阻止 Google 抓取网页,有时候其网址仍可能会显示在搜索结果中(通过其他链接找到),但搜索结果不会包含对该网页的说明: ...
import "github.com/temoto/robotstxt" run go get and you're ready. 1. Parse First of all, you need to parse robots.txt data. You can do it with functions FromBytes(body []byte) (*RobotsData, error) or same for string: robots, err := robotstxt.FromBytes([]byte("User-agent: *\...