_beautifulsoup.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:plugin.video.streamondemand-pureita 作者: orione7 项目源码 文件源码
def renderContents(self, showStructureIndent=None, needUnicode=None):
        """Renders the contents of this tag as a (possibly Unicode) 
        string."""
        s=[]
        for c in self:
            text = None
            if isinstance(c, NavigableUnicodeString) or type(c) == types.UnicodeType:
                text = unicode(c)
            elif isinstance(c, Tag):
                s.append(c.__str__(needUnicode, showStructureIndent))
            elif needUnicode:
                text = unicode(c)
            else:
                text = str(c)
            if text:
                if showStructureIndent != None:
                    if text[-1] == '\n':
                        text = text[:-1]
                s.append(text)
        return ''.join(s)    

    #Soup methods
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号