Colin is daily life record

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

智能api识图

百度智能云

详见:https://v3u.cn/a_id_134

import requests
import base64
import urllib
# 获取token
res = requests.get('https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=7trlpUrrR4NBOLyzY5N0k4Z0&client_secret=97rQtV7gi2ySoLxLbvxME3bHvv2MdrNd')
token = res.json()['access_token']
# 开始智能识图
# 接口地址
url = 'https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic?access_token='+token
# 定义头部信息
myheaders = {'Content-Type':'application/x-www-form-urlencoded'}
# 操作图片
myimg = open('./code.png','rb')
# 读取图片
temp_img = myimg.read()
myimg.close()
# 进行base64编码
temp_data = {'image':base64.b64encode(temp_img)}
# 对图片地址进行urlencode操作
temp_data = urllib.parse.urlencode(temp_data)
# 请求视图接口
res = requests.post(url=url,data=temp_data,headers=myheaders)
# print(res.json())
code = res.json()['words_result'][0]['words']
print(code)
code = str(code).replace(' ','')
print(code)

注:百度智能云不够准确,京东

自动填写验证码

selenium: http://npm.taobao.org/mirrors/chromedriver/

posted on   酷酷的瑞瑞  阅读(18)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示