Skip to main content

subtree

Function subtree 

Source
pub fn subtree(seed_host: &str, url: &Url) -> String
Expand description

页面所在的子树:别的主机(子站)整个算一棵;种子主机上按页面的上级目录分,跳过开头的 语言段,最多两段(/research-highlight/某篇 → research-highlight, /en/education/programmes/x → education/programmes)。只按第一段分的话,整站都在 /en/ 下的站点就成了一棵树,判它枯竭等于停掉整个爬取。seed_host 已去掉 www.、小写。