当前位置: 首页>>代码示例>>Python>>正文


Python Search.fetch_url方法代码示例

本文整理汇总了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()
开发者ID:worstusernameiveevermade,项目名称:web-retrieval,代码行数:28,代码来源:UI.py

示例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()
开发者ID:worstusernameiveevermade,项目名称:web-retrieval,代码行数:24,代码来源:UI.py


注:本文中的search.Search.fetch_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。