python爬虫之赞同知乎用户所有答案以及给用户发私信

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

总之我的帐号已经被封了七天了。你们玩吧~

转载于:https://my.oschina.net/passer007/blog/608417

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值