Python爬虫之得物最新验证码分析
为维护网络绿色健康发展,相关加密已隐藏,代码仅供学习交流,请勿用于非法用途,如有侵权,请联系v: Code-Bin 删除
最近dw更新了新版的验证码
这种比较简单,抓取所有的图片简单弄个分类的模型就能成功识别,我这里使用的是resnet18进行310次训练,最终正确率为98%。
剩下的就简单了,简单的计算一下坐标,即移动的图片初始位置和结束图片的位置坐标
轨迹校验不严,但要首先拿到图片初始位置和结束位置
下面给出python的坐标计算代码
def nv_check_point(nv_x, nv_y):
nv_x -= 38.10000228881836
nv_y -= 159
nv_x_index = None
nv_y_index = None
nv_X = None
nv_Y = None
if abs(nv_x - 45 * 1.3038461538461539) <= (40 * 1.3038461538461539):
nv_x_index = 1
nv_X = 38.10000228881836 + 45 * 1.3038461538461539
elif abs(nv_x - 130 * 1.3038461538461539) <= (40 * 1.3038461538461539):
nv_x_index = 2
nv_X = 38.10000228881836 + 130 * 1.3038461538461539
elif abs(nv_x - 215 * 1.3038461538461539) <= (40 * 1.3038461538461539):
nv_x_index = 3
nv_X = 38.10000228881836 + 215 * 1.3038461538461539
if abs(nv_y - 45 * 1.3038461538461539) <= (40 * 1.3038461538461539):
nv_y_index = 1
nv_Y = 159 + 45 * 1.3038461538461539
elif abs(nv_y - 130 * 1.3038461538461539) <= (40 * 1.3038461538461539):
nv_y_index = 2
nv_Y = 159 + 130 * 1.3038461538461539
return {
"nv_point": str(nv_y_index or 0) + str(nv_x_index or 0),
"nv_center_point": "{},{}".format(nv_X or 0, nv_Y or 0)
}
最后验证一下
没有问题,过了