可扩展的Cookies池,用无头浏览器登录并生成cookie供给爬虫使用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
546 B

8 years ago
import requests
7 years ago
from cookiespool.db import RedisClient
8 years ago
7 years ago
conn = RedisClient('accounts', 'weibo')
8 years ago
def set(account, sep='----'):
6 years ago
username, password = account.split(' ')
8 years ago
result = conn.set(username, password)
print('账号', username, '密码', password)
print('录入成功' if result else '录入失败')
def scan():
print('请输入账号密码组, 输入exit退出读入')
while True:
account = input()
if account == 'exit':
break
set(account)
if __name__ == '__main__':
scan()