美文网首页
2018-12-16

2018-12-16

作者: 梦魇皇朝_0680 | 来源:发表于2018-12-16 15:27 被阅读0次

pip install ansible

def get_id():这个函数用于找到登陆时候的验证码,以及匹配data里面的captcha-id url = 'https://accounts.douban.com/login?' data = requests.get(url).content selector = lxml.html.document_fromstring(data) id = selector.xpath('//input[@name="captcha-id"]/ @value') image_url=selector.xpath('//img[@id="captcha_image"]/@src')这里是下载验证码图片 print(id, image_url) with open('login.png','wb')as f: 

相关文章

网友评论

      本文标题:2018-12-16

      本文链接:https://www.haomeiwen.com/subject/rzcxkqtx.html