'''
about what
'''
from SpiderUtil import getPageUrl
depthDict = {}
def getEmailsDeep(url, depth):
print("\t\t\t" * depthDict[url], "%d级页%s把自己给爬了" % (depthDict[url], url))
if (depthDict[url] >= depth):
return
slist = getPageUrl(url)
for s in slist:
if s not in depthDict:
depthDict[s] = depthDict[url] + 1
res = getEmailsDeep(s, depth)
if __name__ == "__main__":
startUrl = "http://www.baidu.com/s?wd=%E5%B2%9B%E5%9B%BD%20%E9%82%AE%E7%AE%B1"
depthDict[startUrl] = 1
getEmailsDeep(startUrl, 4)
print("main over")