本文整理汇总了Python中CommonsSpiderUtils类的典型用法代码示例。如果您正苦于以下问题:Python CommonsSpiderUtils类的具体用法?Python CommonsSpiderUtils怎么用?Python CommonsSpiderUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommonsSpiderUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeSpecialCharacter
def removeSpecialCharacter(removeContext):
return (
CommonsSpiderUtils.removeSpecialCharacter(removeContext)
.replace("./", "")
.replace(" ", "")
.replace("...", "")
)
示例2: removeSpecialCharacter
def removeSpecialCharacter(removeContext):
return CommonsSpiderUtils.removeSpecialCharacter(removeContext).replace(" ", "")
示例3: removeSpecialCharacter
def removeSpecialCharacter(removeContext):
return CommonsSpiderUtils.removeSpecialCharacter(removeContext).replace('<br />','').replace('</div>','')
示例4: filterContextByTarget
def filterContextByTarget(context,startfilter,endfilter):
return context[CommonsSpiderUtils.filterContext(context,startfilter)+len(startfilter):CommonsSpiderUtils.filterContext(context,endfilter)]
示例5: findAllImageTarget
def findAllImageTarget(context,param):
return len(CommonsSpiderUtils.findAllTarget(context,r'%s'%param))
示例6: filterContextByTarget
def filterContextByTarget(context,startfilter,endfilter):
return CommonsSpiderUtils.filterContextByTarget(context,startfilter,endfilter)
示例7: filterAfterContext
def filterAfterContext(startContext,filterContext):
return startContext[CommonsSpiderUtils.filterContext(startContext,filterContext)+len(filterContext):]
示例8: removeSpecialCharacter
def removeSpecialCharacter(removeContext):
return CommonsSpiderUtils.removeSpecialCharacter(removeContext).replace('../../../','').replace('./','')
示例9: returnStartContext
def returnStartContext(link,filter):
currentContext = CommonsSpiderUtils.openUrl(link)
startContext = CommonsSpiderUtils.startContext(currentContext,filter)
return startContext
示例10: findAllTarget
def findAllTarget(context,filter):
return len(CommonsSpiderUtils.findAllTarget(context,r'%s'%filter))
示例11: returnFilterMainContext
def returnFilterMainContext(startcontext,startfilter,endfilter):
startIndex = CommonsSpiderUtils.filterContext(startcontext,startfilter)+len(startfilter)
endIndex = CommonsSpiderUtils.filterContext(startcontext,endfilter)
return startcontext[startIndex:endIndex]
示例12: returnStartContext
def returnStartContext(link,startFlag):
currentContext = unicode(CommonsSpiderUtils.openInternetUrl(link),'GBK').encode('UTF-8')
startContext = CommonsSpiderUtils.startContext(currentContext,'%s'%startFlag)
return startContext
示例13: retrunStartContext
def retrunStartContext(link):
context = CommonsSpiderUtils.openUrl(link)
startContext = CommonsSpiderUtils.startContext(context,'<tr class="record" valign="top">')
return startContext
示例14: filterTargetFlag
def filterTargetFlag(filterContext,filter):
if CommonsSpiderUtils.filterContext(filterContext,filter) < 0:
return False
else:
return True
示例15: findAllTarget
def findAllTarget(context):
return CommonsSpiderUtils.findAllTarget(context,r'<tr class="record" valign="top">')