栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

红薯网自动化检测

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

红薯网自动化检测

# python
# _*_ coding:utf-8 _*_

from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from PIL import Image
from chaojiying import Chaojiying_Client
bro = webdriver.Chrome(executable_path='./chromedriver.exe')
bro.get('https://so.gushiwen.cn/user/login.aspx?from=http://so.gushiwen.cn/user/collect.aspx')
time.sleep(1)


bro.save_screenshot('aa.png')

code_img_ele = bro.find_element(By.ID,'imgCode')
location = code_img_ele.location 
print(location)
size = code_img_ele.size  
print(size)

rangle = (
    int(location['x']),int(location['y']),int(location['x']+size['width']),int(location['y']+size['height'])
)


i = Image.open('./aa.png')
code_img_name = './code.png'

frame = i.crop(rangle)
frame.save(code_img_name)

chaojiying = Chaojiying_Client('超级鹰账号', '超级鹰密码', '933013')	
im = open('code.png', 'rb').read()											
pic_str = (chaojiying.PostPic(im, 1902)['pic_str'])

user_num = bro.find_element(By.ID,'email')
user_num.send_keys('账号')
time.sleep(1)

password = bro.find_element(By.ID,'pwd')
password.send_keys('密码')
time.sleep(1)

code = bro.find_element(By.ID,'code')
code.send_keys(pic_str)

a_tag = bro.find_element(By.ID,'denglu')
a_tag.click()

time.sleep(1000000)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/869235.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号