python 自动输入验证码
2021/12/11 17:47:09
本文主要是介绍python 自动输入验证码,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
from selenium import webdriver from time import sleep import ddddocr driver = webdriver.Chrome() driver.get('http://121.41.14.39:8088/index.html') driver.find_element_by_css_selector('#username').send_keys('sq1') driver.find_element_by_css_selector('#password').send_keys('123') ele_img = driver.find_element_by_css_selector('img') ocr = ddddocr.DdddOcr() text = ocr.classification(ele_img.screenshot_as_png) # with open('code.png','wb') as f: # f.write(ele_img.screenshot_as_png) #bytes类型,可以保存截图 sleep(2) driver.find_element_by_css_selector('#code').send_keys(text) sleep(2) driver.find_element_by_css_selector('#submitButton').click()
这篇关于python 自动输入验证码的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python