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


Python Node.wrap方法代码示例

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


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

示例1: createHTMLElement

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
    def createHTMLElement(doc, tag):
        if isinstance(tag, BeautifulSoup.NavigableString):
            return Node.wrap(doc, tag)

        if log.ThugOpts.Personality.isIE():
            if tag.name.lower() in ('t:animatecolor', ):
                return TAnimateColor.TAnimateColor(doc, tag)

        if tag.name.lower() in DOMImplementation.TAGS:
            return DOMImplementation.TAGS[tag.name.lower()](doc, tag)
        else:
            return HTMLElement.HTMLElement(doc, tag)
开发者ID:Debug-Orz,项目名称:thug,代码行数:14,代码来源:DOMImplementation.py

示例2: previousSibling

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
 def previousSibling(self):
     return Node.wrap(self.doc, self.tag.previous_sibling)
开发者ID:HardlyHaki,项目名称:thug,代码行数:4,代码来源:Element.py

示例3: nextSibling

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
 def nextSibling(self):
     return Node.wrap(self.doc, self.tag.next_sibling)
开发者ID:HardlyHaki,项目名称:thug,代码行数:4,代码来源:Element.py

示例4: lastChild

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
 def lastChild(self):
     return Node.wrap(self.doc, self.tag.contents[-1]) if len(self.tag) > 0 else None
开发者ID:HardlyHaki,项目名称:thug,代码行数:4,代码来源:Element.py

示例5: parentNode

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
 def parentNode(self):
     return Node.wrap(self.doc, self.tag.parent) if self.tag.parent else None
开发者ID:HardlyHaki,项目名称:thug,代码行数:4,代码来源:Element.py

示例6: childNodes

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import wrap [as 别名]
 def childNodes(self):
     from NodeList import NodeList
     #return NodeList(self.doc, self.tag.contents)
     return Node.wrap(self.doc, NodeList(self.doc, self.tag.contents))
开发者ID:andrewmichaelsmith,项目名称:thug,代码行数:6,代码来源:Element.py


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