#本文供学习交流之用 注意:图形验证码的识别 from selenium.webdriver import Chrome from selenium.webdriver.common.by import By from chaojiying import Chaojiying_Client import time web = Chrome() web.maximize_window() web.get("https://www.chaojiying.com/user/login/") time.sleep(3) web.find_element(By.XPATH,"/html/body/div[3]/div/div[3]/div[1]/form/p[1]/input").send_keys("13582413297") time.sleep(3) web.find_element(By.XPATH,"/html/body/div[3]/div/div[3]/div[1]/form/p[2]/input").send_keys("lfsysc0104") time.sleep(3) img=web.find_element(By.XPATH,"/html/body/div[3]/div/div[3]/div[1]/form/div/img").screenshot_as_png chaojiying = Chaojiying_Client('135***13297', 'lf**0104', '96**67') dic=chaojiying.PostPic(img, 1902) mycode=dic['pic_str'] web.find_element(By.XPATH,"/html/body/div[3]/div/div[3]/div[1]/form/p[3]/input").send_keys(mycode) time.sleep(10) web.find_element(By.XPATH,"/html/body/div[3]/div/div[3]/div[1]/form/p[4]/input").click() time.sleep(100)