本文整理汇总了Python中fit.Parse.Parse.tag方法的典型用法代码示例。如果您正苦于以下问题:Python Parse.tag方法的具体用法?Python Parse.tag怎么用?Python Parse.tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fit.Parse.Parse
的用法示例。
在下文中一共展示了Parse.tag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copyParse
# 需要导入模块: from fit.Parse import Parse [as 别名]
# 或者: from fit.Parse.Parse import tag [as 别名]
def copyParse(tables):
if tables is None:
return None
parse = Parse(tag="", body=tables.body,
parts=copyParse(tables.parts), more=copyParse(tables.more))
parse.tag = tables.tag
parse.end = tables.end
parse.leader = tables.leader
parse.trailer = tables.trailer
return parse
示例2: ResultingHTML
# 需要导入模块: from fit.Parse import Parse [as 别名]
# 或者: from fit.Parse.Parse import tag [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)