本文整理汇总了Python中fit.Parse.Parse.addToTag方法的典型用法代码示例。如果您正苦于以下问题:Python Parse.addToTag方法的具体用法?Python Parse.addToTag怎么用?Python Parse.addToTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fit.Parse.Parse
的用法示例。
在下文中一共展示了Parse.addToTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ResultingHTML
# 需要导入模块: from fit.Parse import Parse [as 别名]
# 或者: from fit.Parse.Parse import addToTag [as 别名]
def ResultingHTML(self):
table = Parse(self.OriginalHTML)
row = table.at(0, self.Row - 1)
cell = row.at(0, self.Column - 1)
if (self.OverwriteCellBody is not None):
cell.body = self.OverwriteCellBody
if (self.AddToCellBody is not None):
cell.addToBody(self.AddToCellBody)
if (self.OverwriteCellTag is not None):
cell.tag = self.OverwriteCellTag
if (self.OverwriteEndCellTag is not None):
cell.end = self.OverwriteEndCellTag
if (self.AddToCellTag is not None):
cell.addToTag(self.stripDelimiters(self.AddToCellTag))
if (self.OverwriteRowTag is not None):
row.tag = self.OverwriteRowTag
if (self.OverwriteEndRowTag is not None):
row.end = self.OverwriteEndRowTag
if (self.AddToRowTag is not None):
row.addToTag(self.stripDelimiters(self.AddToRowTag))
if (self.OverwriteTableTag is not None):
table.tag = self.OverwriteTableTag
if (self.OverwriteEndTableTag is not None):
table.end = self.OverwriteEndTableTag
if (self.AddToTableTag is not None):
table.addToTag(self.stripDelimiters(self.AddToTableTag))
if (self.AddCellFollowing is not None):
self.addParse(cell, self.AddCellFollowing, ["td"])
if (self.RemoveFollowingCell is not None):
self.removeParse(cell)
if (self.AddRowFollowing is not None):
self.addParse(row, self.AddRowFollowing, ["tr", "td"])
if (self.RemoveFollowingRow is not None):
self.removeParse(row)
if (self.AddTableFollowing is not None):
self.addParse(table, self.AddTableFollowing,
["table", "tr", "td"])
return self.GenerateOutput(table)
示例2: buildCells
# 需要导入模块: from fit.Parse import Parse [as 别名]
# 或者: from fit.Parse.Parse import addToTag [as 别名]
def buildCells(self, row):
if not row:
nil = Parse(tag="td",body="None",parts=None,more=None)
nil.addToTag(" colspan="+str(len(self.columnBindings)))
return nil
next = root = Parse(None, None, None, None)
for i in range(len(self.columnBindings)):
next.more = Parse(tag="td",body=" ",parts=None,more=None)
next = next.more
a = self.columnBindings[i]
if not a:
self.ignore(next)
else:
try:
a.target = row
next.body = self.gray(self.escape(a.toString(a.get())))
except Exception, e:
self.exception(next, e)