本文整理汇总了Python中search.Search.fetch_url方法的典型用法代码示例。如果您正苦于以下问题:Python Search.fetch_url方法的具体用法?Python Search.fetch_url怎么用?Python Search.fetch_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search.Search
的用法示例。
在下文中一共展示了Search.fetch_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: searchAction
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import fetch_url [as 别名]
def searchAction(event):
try:
global query
global mTime
mTime = StringVar(None)
query = StringVar(None)
search_ = Search()
query = self.searchEntry1.get()
if query not in (None, '', ' '):
start_time = time.time()
global title_url
title_url = [None]
raw = search_.fetch_url(query)
title_url = search_.process_url(raw)
self.masters.withdraw()
mTime = (time.time() - start_time)
self.guiresults()
self.timeLabelres = Label(self.masters, text="--- %s seconds ---" % (mTime), font=('arial',8))
self.timeLabelres.place(x=150,y=630)
else:
tkMessageBox.showinfo('Info', 'You must put a keyword')
except Exception as e:
tkMessageBox.showinfo('Info', 'No Internet Connection Try Again Later')
exit()
示例2: searchBtn
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import fetch_url [as 别名]
def searchBtn(self, event):
try:
global xTime
global query
xTime = StringVar()
query = StringVar(None)
search_ = Search()
query = self.searchEntry.get()
if query not in (None, '', ' '):
start_time = time.time()
global title_url
title_url = [None]
raw = search_.fetch_url(query)
title_url = search_.process_url(raw)
self.master.withdraw()
xTime = (time.time() - start_time)
self.guiresults()
else:
tkMessageBox.showinfo('Info', 'You must put a keyword')
except Exception as e:
tkMessageBox.showinfo('Info', 'No Internet Connection Try Again Later')
exit()