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


Python CleanText.replaceSingleQuotesWithTwoSingleQuotes方法代码示例

本文整理汇总了Python中Classes.CleanText.CleanText.replaceSingleQuotesWithTwoSingleQuotes方法的典型用法代码示例。如果您正苦于以下问题:Python CleanText.replaceSingleQuotesWithTwoSingleQuotes方法的具体用法?Python CleanText.replaceSingleQuotesWithTwoSingleQuotes怎么用?Python CleanText.replaceSingleQuotesWithTwoSingleQuotes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Classes.CleanText.CleanText的用法示例。


在下文中一共展示了CleanText.replaceSingleQuotesWithTwoSingleQuotes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doSingleArraysForSameNumberElements

# 需要导入模块: from Classes.CleanText import CleanText [as 别名]
# 或者: from Classes.CleanText.CleanText import replaceSingleQuotesWithTwoSingleQuotes [as 别名]
    def doSingleArraysForSameNumberElements(self):
        for i in range(len(self.arrayOfTitles)):
            elementTitle = self.arrayOfTitles[i].text
            elementLink = self.arrayOfLinks[i]
            elementDescription = self.arrayOfDescriptions[i].text

            singleResultArray = [elementTitle, elementLink,
                                 CleanText.replaceSingleQuotesWithTwoSingleQuotes(elementDescription)]
            self.arrayOfGoogleLeads.append(singleResultArray)
开发者ID:kyajmiller,项目名称:Cerebro,代码行数:11,代码来源:GoogleLeads.py

示例2: doSingleArraysForUnevenNumberElements

# 需要导入模块: from Classes.CleanText import CleanText [as 别名]
# 或者: from Classes.CleanText.CleanText import replaceSingleQuotesWithTwoSingleQuotes [as 别名]
    def doSingleArraysForUnevenNumberElements(self):
        stringOfMatchedDivParts = self.driver.find_elements_by_xpath(
            "//h3[contains(concat(' ', @class, ' '), 'r')]/following-sibling::div/div")
        for element in stringOfMatchedDivParts:
            elementParts = element.text.split('\n', 2)
            elementTitle = ''
            elementLink = ''
            elementDescription = ''

            if len(elementParts) == 3:
                elementLink = elementParts[0]
                elementTitle = elementParts[1]
                elementDescription = elementParts[2]
            elif len(elementParts) == 2:
                elementLink = elementParts[0]
                elementDescription = elementParts[1]

            if not re.search('^https?://', elementLink):
                elementLink = 'http://' + elementLink

            singleResultArray = [elementTitle, elementLink,
                                 CleanText.replaceSingleQuotesWithTwoSingleQuotes(elementDescription)]
            self.arrayOfGoogleLeads.append(singleResultArray)
开发者ID:kyajmiller,项目名称:Cerebro,代码行数:25,代码来源:GoogleLeads.py

示例3: __init__

# 需要导入模块: from Classes.CleanText import CleanText [as 别名]
# 或者: from Classes.CleanText.CleanText import replaceSingleQuotesWithTwoSingleQuotes [as 别名]
    def __init__(self, iefaLeadArray, fundingClassification, badScholarshipClassification):
        self.iefaLeadArray = iefaLeadArray
        self.fundingClassification = fundingClassification
        self.badScholarshipClassificaion = badScholarshipClassification
        self.db = SUDBConnect()
        self.fileSystemDB = SUDBConnect(destination='filesystem')

        self.name = self.iefaLeadArray[0]
        self.url = self.iefaLeadArray[1]
        self.url = CleanText.replaceSingleQuotesWithTwoSingleQuotes(self.url)
        self.sponsor = self.iefaLeadArray[2]
        self.submissionDeadline = self.iefaLeadArray[3]
        self.majors = self.iefaLeadArray[4]
        self.amount = self.iefaLeadArray[5]
        self.description = self.iefaLeadArray[6]
        self.otherCriteria = self.iefaLeadArray[7]
        self.numberAwards = self.iefaLeadArray[8]
        self.hostInstitution = self.iefaLeadArray[9]
        self.includes = self.iefaLeadArray[10]
        self.nationalityRequired = self.iefaLeadArray[11]
        self.hostCountries = self.iefaLeadArray[12]
        self.sourceWebsite = self.iefaLeadArray[13]
        self.sourceText = self.iefaLeadArray[14]
        self.date = time.strftime('%Y%m%d')
开发者ID:kyajmiller,项目名称:Cerebro,代码行数:26,代码来源:InsertIefaLeadArrayIntoIefaLeadsDB.py


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