humiaozuzu / wechat-explorer

微信聊天记录导出、分析工具
498 stars 106 forks source link

get_friends问题 #3

Open zhiqihuang opened 8 years ago

zhiqihuang commented 8 years ago

Traceback (most recent call last): File "/usr/local/bin/wexp", line 11, in sys.exit(main()) File "/Library/Python/2.7/site-packages/we/run.py", line 52, in main friends = wechat.get_friends() File "/Library/Python/2.7/site-packages/we/wechat.py", line 81, in get_friends label_list_str = re.search(label_pattern, row[13], re.MULTILINE).group(1) AttributeError: 'NoneType' object has no attribute 'group'

具体原因没有深究,但是可以通过修改条件避免Nonetype

def get_friends(self): chat_db = self.path + '/%s/DB/MM.sqlite' % self.user_hash logger.debug('DB path %s' % chat_db) conn = sqlite3.connect(chat_db)

    friends = []
    for row in conn.execute('SELECT f.*,fe.ConStrRes2, fe.ConRemark FROM Friend as f JOIN Friend_Ext as fe USING(UsrName) WHERE `Type` NOT IN %s AND `UsrName` NOT LIKE "gh_%%"' % FriendTypeExlude.__str__()):
        label_pattern = '<LabelList>(.*)</LabelList>'
        if re.search(label_pattern, row[13], re.MULTILINE) == None:
            pass
        else:
            .........
humiaozuzu commented 8 years ago

Thx 我稍后修复

zhiqihuang commented 8 years ago

感谢回复。请问你知道如何抓取朋友圈数据吗?

On Thursday, February 25, 2016, Maple notifications@github.com wrote:

Thx 我稍后修复

— Reply to this email directly or view it on GitHub https://github.com/humiaozuzu/wechat-explorer/issues/3#issuecomment-189060746 .

huanglongyu commented 7 years ago

hello 有办法获取朋友的其他信息吗 ? 比如 标签,签名, 描述等