我如何阻止字母以阻止崩溃

时间:2019-11-24 04:22:40

标签: python python-3.x

在此代码中是否可以阻止字符(字母)

visited = set()                                                                     
storedlinks = set()  

def crawler(url):                                                                   
    'Take an url, crawl all links under that domain name.'
    visited.add(url)                                                                
    if linkchunk in url:                 # Check if under the domain                                                         
        storedlinks.add(url)                                                                
        links = analyze(url)             # analyze is function to get hyperlinks                                                    

        counter = 0
        for link in links:               # Check new links                                                   
            if link in visited:          # Check if it's visited
                counter += 1         
                if counter == len(links):  # if all link in visited, then stop
                    break
            else:                                                                       
                try:                                                                    
                    print(link)
                    crawler(link)
                except:                                                                 
                    pass

    return storedlinks           

我正在开发一个计算器应用程序,我想通过阻止所有字母来阻止崩溃。

0 个答案:

没有答案