import redis
a = redis.Redis("127.0.0.1", "6379")
content = {"url": 'https://www.baudu.com', "callback": "parse", }
content = json.dumps(content) # 将字典转化为json
a.sadd('百度', content) # 存入内容
import redis
a = redis.Redis("127.0.0.1", "6379")
content = {"url": 'https://www.baidu.com', "callback": "parse", }
content = json.dumps(cont) # 将字典转化为json
a.sadd('task:百度:start_urls', content) # 存入内容
网友评论