def analyze_html(url, root_url):
savepath = download_file(url)
if savepath is None:
return # here
if savepath in proc_files:
return # here
proc_files[savepath] = True
print("analyze_html", url)
html = open(savepath, "r", encoding="utf-8").read()
links = enum_links(html, url)
for link_url in links:
if link_url.find(root_url) != 0:
if not re.search(r".css$", link_url):
continue
if re.search(r".(html|htm)$", link_url):
analyze_html(link_url, root_url)
continue
download_file(link_url)
请参阅我用双星号包装的if语句。 我认为在“返回”之后总是必须有一些东西才能被退回。 这是什么意思?