twitter 安装redis
安装
python ‘pip install redis’
sudo apt-get install redis-server
sudo service redis-server start
<twisted.python.failure.Failure OpenSSL.SSL.Error: [(‘SSL routines’, ‘SSL23_GET_SERVER_HELLO’, ‘sslv3 alert handshake failure’)
openSSl 版本问题,去掉了RC4-MD5
用 scrapy version -v 查询版本号
pip install –upgrade ‘cryptography<2’
https://stackoverflow.com/questions/45924568/scrapy-twisted-connection-lost-in-non-clean-fashion-no-proxy-already-tried-hea
https://github.com/scrapy/scrapy/issues/2311#issuecomment-325804964
redis 查看数据
redis-cli key 查询
del * 删除键
TypeError: Unicode-objects must be encoded before hashing python 3
shaa1 = hashlib.sha1()
‘shaa1.update(string.encode(‘utf-8’))
res = shaa1.hexdigest()
print(“sha1采用encode转换加密结果:”,res)
https://www.cnblogs.com/pycode/p/hashlib.html
redis的值有5种类型,不同的类型有不同的命令来获取:
字符直接 get key
队列 左端弹出一个元素 LPOP key
哈希 HGET key field
集合 SMEMBERS key 返回集合中的所有元素
有序集合ZRANGE key start stop