运行结果是空
#导入开发包 from urllib.request import urlopen from bs4 import BeautifulSoup import re resp = urlopen("https://zh.wikipedia.org/wiki/Wikipedia:%E9%A6%96%E9%A1%B5").read().decode("utf-8") soup = BeautifulSoup(resp,"html.parser") listUrls = soup.findAll("a", href=re.compile("^/wiki/")) for url in listUrls: print(url("href"))