當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。