本文整理汇总了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)
示例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)
示例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')