转载需注明原文地址:http://blog.csdn.net/btyh17mxy/article/details/25207889
刚写的模拟登陆的方式从获取微信公众平台消息列表和用户头像的库,之后还会继续增加相关功能,github地址https://github.com/btyh17mxy/wxwall
#!/usr/bin/env python
# coding: UTF-8
import json
import hashlib
import re
import random
import json
import requests
import logging
DEBUG_LEVEL = logging.DEBUG
try:
import colorizing_stream_handler
root = logging.getLogger()
root.setLevel(DEBUG_LEVEL)
root.addHandler(colorizing_stream_handler.ColorizingStreamHandler())
except Exception, e:
print 'can not import colorizing_stream_handler, using logging.StreamHandler()'
root = logging.getLogger()
root.setLevel(DEBUG_LEVEL)
root.addHandler(logging.StreamHandler())
'''base exception class.
'''
class WeixinPublicError(Exception):
pass
'''raise when cookies expired.
'''
class WeixinNeedL