當前位置: 首頁>>代碼示例>>Python>>正文


Python Crawler.save_lists方法代碼示例

本文整理匯總了Python中Crawler.Crawler.save_lists方法的典型用法代碼示例。如果您正苦於以下問題:Python Crawler.save_lists方法的具體用法?Python Crawler.save_lists怎麽用?Python Crawler.save_lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Crawler.Crawler的用法示例。


在下文中一共展示了Crawler.save_lists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: crawl

# 需要導入模塊: from Crawler import Crawler [as 別名]
# 或者: from Crawler.Crawler import save_lists [as 別名]
    def crawl(max_page):
        text.delete('1.0', END)
        text.insert(END, 'Currently Crawling Please Wait\n')
        search_engine.update()

        count = int(max_page)
        while len(Crawler.queue) > 0 and count > 0:
            queue = str(Crawler.queue.pop())
            Crawler.crawl(queue)
            count -= 1
            text.insert(END, 'Currently Crawling: ' + queue + '\n')
            search_engine.update()

        print('Crawl Finished Can Now Search')
        text.delete('1.0', END)
        text.insert(END, 'Crawl Finished Can Now Search\n')
        text.insert(END, str(len(Crawler.crawled)) + " Url's have been Crawled and Indexed \n")
        text.insert(END, str(len(Crawler.queue)) + " Total Number of Url's In Queue\n")
        search_engine.update()

        Crawler.save_lists()
開發者ID:Gunn3r1995,項目名稱:Search,代碼行數:23,代碼來源:main.py

示例2: Label

# 需要導入模塊: from Crawler import Crawler [as 別名]
# 或者: from Crawler.Crawler import save_lists [as 別名]
    crawl_button.pack()

    label = Label(window, text='Enter a Word to Search')
    label.pack()

    search_input = Entry(window)
    search_input.insert(END, 'Shane')
    search_input.pack()

    search_button = Button(window, text='Search', command=lambda: search(search_input.get()))
    search_button.pack()

    scrollbar = Scrollbar(window)
    scrollbar.pack(side=RIGHT, fill=Y)

    text = Text(window, wrap=WORD, yscrollcommand=scrollbar.set)
    text.pack()

    scrollbar.config(command=text.yview)

    text.insert(END, str(len(Crawler.crawled)) + " Url's have been Crawled and Indexed \n")
    text.insert(END, str(len(Crawler.queue)) + " Total Number of Url's In Queue\n")

    search_engine.mainloop()

Crawler.create_file()
init_gui()

Crawler.save_lists()
sys.exit()
開發者ID:Gunn3r1995,項目名稱:Search,代碼行數:32,代碼來源:main.py


注:本文中的Crawler.Crawler.save_lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。