本文整理汇总了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()
示例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()