wechatUtils.py 文件源码

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

项目:wechat-analysis 作者: jambus 项目源码 文件源码
def handleXMLContentFromMessage(content):

        rootNode = None
        if len(content) < 5:
            print ('It is not valid xml content:' + str(content))
            return rootNode
        else:
            if content[0:5] != '<msg>':
                content = '\n'.join(content.split('\n',2)[1:])

            try:    
                rootNode = ET.fromstring(content)
            except ET.ParseError as args:
                #print ('It is not valid xml content (' , args,'):\n',content)
                rootNode = None

            return rootNode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号