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