from zhihu import ZhihuClient
from zhihu import Author
from zhihu import Question
import time
client = ZhihuClient()
username = '904727147@qq.com'#use email not tel
password = ''#your password
captcha = client.get_captcha()
f = open('/root/Desktop/cap.gif','wb')
f.write(captcha)
f.close()
cap = input('请输入验证码:')
test = client.login(username,password,cap)
print(test)
me = client.me()
questions = client.question('https://www.zhihu.com/question/24590883')#it's my
for author in questions.followers:
if(int(author.follower_num)>10):
print('正在进行用户:',author.name)
me.send_message(author,'这是一条知乎爬虫,需要源码的可以关注私信我!')
print('发送给用户:'+author.name+'成功')
ans = author.answers
i = 0
for x in ans:
me.vote(x,vote='up')
print('点赞成功!')
me.thanks(x,thanks=True)
i+=1
print('感谢成功! [',i,']')
else:
time.sleep(10)
continue
总之我的帐号已经被封了七天了。你们玩吧~