码迷,mamicode.com
首页 > 编程语言 > 详细

挂号网python自动化登录

时间:2017-06-12 22:30:14      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:自动化登录

 __author__ = selenium webdriver
selenium.webdriver.common.action_chains ActionChains
time
pytesseract
PIL Image

driver = webdriver.Firefox()
driver.get()
driver.maximize_window()


driver.find_element_by_id().send_keys() driver.find_element_by_id().send_keys() driver.maximize_window()  driver.save_screenshot()  imgelement = driver.find_element_by_xpath()
location = imgelement.location  size=imgelement.size  rangle=((location[])(location[])(location[]+size[])(location[]+size[])) i=Image.open() frame4=i.crop(rangle)  frame4.save()
qq=Image.open()
text = pytesseract.image_to_string(qq).strip() time.sleep()
text
driver.find_element_by_id().send_keys(text)
time.sleep()
driver.find_element_by_id().click()

先是条环境,从网上找资料。最终终于可以登录,但是验证码辨认不是很高,登录失败率比较高。

挂号网python自动化登录

标签:自动化登录

原文地址:http://xueba.blog.51cto.com/950993/1934694

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!