selunium+python+chrome=驾校约课系统

每天要和30+人抢课,还得在00:00,简直了,所以搞个抢课系统

#  -*- coding:UTF-8 -*-
#python2.7
#2017-11-21
#Version 1.0
#chrome
#import
from webbrowser import browser
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import  expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from datetime import datetime, timedelta
import pytesser
import sys
from PIL import Image,ImageEnhance
import time
SECONDS_PER_DAY = 24 * 60 * 60

def getdigit(t):  # 用于获取整数的位数
    if t == 0:
        return 1
    else:
        c = 0
        while t != 0:
            t = t / 10
            c += 1
        return c

def login():

    time.sleep(4)

    # 截取网页
    driver.get_screenshot_as_file('F:\carProject\demo\image\image1.png')  # 比较好理解
    # 截取验证码
    imgelement = driver.find_element_by_xpath('//*[@id="yzm"]')
    location = imgelement.location
    size = imgelement.size
    rangle = (
        int(location['x']), int(location['y']), int(location['x'] + size['width']),
        int(location['y'] + size['height'])
    )
    im = Image.open('F:\carProject\demo\image\imag
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sethnieTech

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值