爬虫网易易盾滑块及轨迹算法案例:某乎

这篇具有很好参考价值的文章主要介绍了爬虫网易易盾滑块及轨迹算法案例:某乎。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

声明:
该文章为学习使用,严禁用于商业用途和非法用途,违者后果自负,由此产生的一切后果均与作者无关

一、滑块初步分析
  1. js运行 atob(‘aHR0cHM6Ly93d3cuemhpaHUuY29tL3NpZ25pbg==’) 拿到网址,浏览器打开网站,F12打开调试工具,清除cookie、storage,刷新页面
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

  2. 在Network中找到api/v2/getconf、v3/d请求,后续扣代码会用到响应结果返回的值,这两个请求中只有v3/d中的d参数是需要扣代码的,api/v2/getconf中的id是网站id,每个网站是唯一的,写固定即可
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

  3. 输入账号密码点击登录,找到v3/b、api/v3/get请求,其中v3/b请求中的d参数是需要解密的,api/v3/get请求中的acToken、fp、cb等参数是需要解密的,api/v3/get返回的是图片信息
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

  4. 验证滑块找到api/v3/check请求,该请求中data、cb等参数是需要解密的,验证成功validate是有值的,后续登录会用到会用到响应结果中的值
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

  5. 根据上面分析破解滑块需要解密这些请求api/v2/getconf、v3/d、v3/b、api/v3/get、api/v3/check中的参数,其中api/v2/getconf是没有加密参数的,鼠标右击请求找到Copy>Copy as cUrl(cmd),打开网站:https://spidertools.cn/#/curl2Request,把拷贝好的curl转成python代码,新建 yiduSlider.py,把代码复制到该文件
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

  6. 修改yiduSlider.py吧request请求替换成requestSession请求,并把id参数单独拿出来,点击运行yiduSlider.py,请求响应成功
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python

二、分析api/v3/get加密cb参数
  1. 新建getCb.js文件,用于放扣下的js代码
  2. 清除cookie、storage,刷新页面,随便输入账号密码登录,找到api/v3/get请求,从请求堆栈中找到第一个文件点击进去,搜索cb":,搜到的地方全部下断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  3. 刷新滑块,会进入其中一个断点,而且在断点位置处会发现很多请求参数,说明参数生成的的逻辑都在该文件
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  4. ast编译js文件,自己随便写的ast,就不贴代码了,如果没有ast编译,可忽略此步骤;该文件加载时候后面有个时间戳,是会动态改变的,时间戳改变js回重新加载,所以要把时间戳值固定下来,找到load.min.js,本地替换下搜索script:,会找到时间戳赋值的地方,我这里改成了1,刷新页面,输入账号密码登录,找到api/v3/get请求会发现该文件加载是时间戳已变为1;点击进去该文件,右击文件名点击Override content本地替换文件,把编译好的ast代码替换该文件,文件替换之后需要刷新页面,刷新页面后如果滑块图片不能正常加载,说明ast加载有问题;如果没问题,就找到之前的位置下断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  5. 刷新滑块会进入该断点,在断点处会发现,cb是n2()调用生成的,鼠标悬浮到n2,找到该方法,分析方法内部nl经过nz处理并return出去,而nl是一个uuid方法生成,且参数是32,在return处断点,并把代码拷贝到getCb.js;未混肴的js,鼠标悬浮到对应位置可查看具体信息
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  6. 点击跳过断点,会进入刚才的断点,鼠标悬浮到nk[“uuid”]、nz会在找到方法,方法拷贝到getCb.js,并在uuid内部断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  7. 调用getUuid(32),执行getCb.js会发现无报错;如果是未经过ast转换,这里是会报错,函数内部经过G函数调用获取n的值,虽然最上面n已赋值,但是在红圈圈的地方n值又重新排序,这些都是文件记载时初始化的,把正确的n值、G函数拷贝到getCb.js即可
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  8. 调用getCb,执行getCb.js会发现报nZ的错误,在nG方法内部断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  9. 点击跳过断点,会进入该断点,鼠标悬浮到nZ,会发现该方法是B函数调用,把B拷贝到getCb.js;B方法内部基本也是经过G函数调用获取的n中的值;再运行getCb.js,会发现window的错误window[“encodeURIComponent”],这里可以直接使用encodeURIComponent©做替换
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  10. 再运行getCb.js会发现报了D错误,在函数B函数内部断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  11. 点击跳过断点,会进入刚才的断点,鼠标悬浮D,找到该函数,把该函数拷贝到getCb.js,运行getCb.js,报的其他错误说明nZ已扣成功
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  12. 就这样重复运行getCb.js,按照报错的提示把代码扣完即可;每个函数都要点进去查看,有时候可能扣到了该函数,但是调用的时候,可能不是该函数,因为可能会在其他地方重新命名该函数,要注意上下文代码
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
三、分析api/v3/get加密fp参数
  1. 新建getFp.js,用于放扣下的代码
  2. 刷新滑块,找到cb断点处,会发现fp=na,na=nU[“fingerprint”],鼠标悬浮nU[“fingerprint”]查看值,并把cookie输出到控制台会发现取得是cookie中的gdxidpyhxdE
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  3. 使用油猴创建hook并开启,拦截cookie
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  4. 清除cookie,刷新页面,会进入油猴拦截cookie的断点,点击跳过断点,直到看到val有值,点击跳过当前函数执行,看到类似cookie的值后停下,分析代码会发现gdxidpyhxdE = Go,而Go=GI,GI的生成依赖与GY,GY在上面赋值了一个空数组,说明Go的生成就在GY = []到G0 = GI;这段代码,只要把这段代码中的相关逻辑扣出来就行
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  5. 扣代码的方法和按照扣cb参数时的方法就行,其中大部分都在初始化生成,直接复制到getFp.js文件即可
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
四、分析api/v3/get加密acToken参数
  1. 新建acToken.js用于放扣下的js代码
  2. 刷新滑块,找到cb断点处,在断点处的下面会看到,acToken = G7,而G7,是由getToen方法生成,鼠标悬浮getToken,找到该方法
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  3. 进入该方法后,会看到另外getToken方法,这其中传了一个参数bid、函数,函数返回值T就是acTokken,把值在bid在控制台输出,在Network中搜索一下会发现这个值是api/v2/getconf请求响应结果,那么只要分析出这个getToken方法就可以,鼠标悬浮到acToken会找到该方法位置,然后遇到函数就在函数处下断点,直到找到真正生成acToken的位置
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  4. 经过几次断点调试,会发现r.prototype.ka函数,函数内部的pE({C: u,ma: d})就是生成acToken的位置,其中传的参数中的u、d是在r.prototype.ka函数内部生成的,d是f布尔值fasle不用管,u是kE函数生成的,直接扣到js文件就行
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  5. 鼠标悬浮到PE方法,会找到PE函数,分析里面代码会发现是return是经过OE方法调用的结果,而OE参数是经过JSON.stringify转换的E,把E输出到控制台,会发现E里面有三个值r、b、d,其中b是之前的u,复制d的值在Network中搜索会发现d是v3/d请求返回的,这里会发现虽然在最初传了bid参数,但是在最终生成acToken中并没有用到,r是固定值
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  6. 扣完acToken.js代码部分示例,除了b、d都是固定的值
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  7. 修改yiduSlider.py,初步验证api/v3/get请求,会发现图片已经获取成功
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
五、分析v3/d加密d参数
  1. 新建getD.js,用于放扣下的代码
  2. 添加xhr,拦截v3/d请求
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  3. 清除缓存刷新页面,会进入xhr断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  4. 一直点击跳过当前函数执行,看见类似下图代码在r =行下个断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  5. 清除缓存刷新页面,会进入刚才的断点,控制台输出r的值,并复制给test
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  6. 在Network中找到v3/d请求,把参数复制到控制台并赋值给test1,控制台输出 test == test1,会发现返回true,说明刚才的断点就是d参数生成的位置
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  7. 清除缓存刷新页面,再出进入刚才的断点,分析代码会发现生成加密方法的参数传了 a.concat(r, t),其中a=f()、t=o(!0),而 r 是JE(u, Z[8]) 回调函数返回过来的,把分析得代码,复制到getD.js,先把a=f()、t=o(!0)代码补全,再去扣JE(u, Z[8])
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  8. 运行getD.js,会发现报wa[h[420]][Y[75]],在f()函数内断点,清除缓存刷新页面找到f()断点,把wa[h[420]][Y[75]]在控制台输出,会发现包含很多信息,在文件内搜索productNumber会找到这个json信息赋值得地方,在赋值得地方打上断点
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  9. 清除缓存刷新页面,会进入刚才得断点,把E在控制台输出,在Network中找到api/v2/getconf请求,对比请求响应结果会发现E中得有些字段是请求中返回,这些字段不能写死,除了这些字段其他都是固定的值
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  10. o(!0) 写死就行,断点调试的时候,会发现里面的函数调用返回的都是固定值,只不过取值的时候顺序是随机返回的,把t值替换成固定的,清除缓存刷新页面查看v3/d请求会发现一样可以请求成功
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  11. RE(iE, Z[678], void 0),断点调试时会发现E.apply(a, arguments),其实是执行了iE,而参数是a.concat(r, t)合并后的数组,所以只把iE扣出来就行,IE函数中没什么特别注意的,直接断点扣就行
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  12. JE(u, Z[8]) 和 o(!0) 情况类似,写死就行,还有一种验证方法就是,取两次值,排序后对比下会发现值都是一样的只是顺序不一样,排序方法:r.sort()
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  13. 修改yiduSlider.py,替换v3/d请求中的d参数会发现依然可以请求获取成功
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
六、分析api/v3/check加密data、cb参数
  1. 分析api/v3/check加密cb和分析api/v3/get加密cb,过程一样找到api/v3/check请求,通过请求栈进入js文件,搜索cb":,在搜索到的地方全部打断点,然后验证滑块,会进入其中一个断点,会发现这个cb参数和api/v3/get一样同样调用的是n2方法生成,而data = G5,G5=ne[“data”]
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  2. 在文件内搜索"data":,找到带有d赋值的data打断点,并把JSON[“stringify”]生成的data值用赋值给window.test用于测试给位置是否是生成data的位置,把之前的G5替换成window.test,拖动滑块验证,会进入断点,到G5断点的时候,在控制台把G5的值赋值给test1,点击跳过断点,会发现api/v3/check请求成功,在控制台对比test1、window.test中d的值 JSON.parse(test1).d == JSON.parse(window.test).d 会发现是一样的,说明data参数就是在刚才的断点生成,然后还原之前window.test代码
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
  3. 再次拖动滑块验证,会进入data生成的断点,会发现几个关键的值this[“ s t o r e " ] [ " s t a t e " ] [ " t o k e n " ] 、 t h i s [ " t r a c e D a t a " ] 、 t h i s [ " a t o m T r a c e D a t a " ] 、 t h i s [ " store"]["state"]["token"]、this["traceData"]、this["atomTraceData"]、this[" store"]["state"]["token"]this["traceData"]this["atomTraceData"]this["jigsaw”][“style”][“left”]、this[“mouseDownCounts”]、this[“width”],其中this[“ s t o r e " ] [ " s t a t e " ] [ " t o k e n " ] 是 a p i / v 3 / g e 请求响应成功中的 t o k e n 、 t h i s [ " a t o m T r a c e D a t a " ] 轨迹、 t h i s [ " t r a c e D a t a " ] 是轨迹经过处理后的字符串、 t h i s [ " m o u s e D o w n C o u n t s " ] 固定值 1 、 t h i s [ " w i d t h " ] 是图片宽、 t h i s [ " store"]["state"]["token"]是api/v3/ge请求响应成功中的token、this["atomTraceData"]轨迹、this["traceData"]是轨迹经过处理后的字符串、this["mouseDownCounts"]固定值1、this["width"]是图片宽、this[" store"]["state"]["token"]api/v3/ge请求响应成功中的tokenthis["atomTraceData"]轨迹、this["traceData"]是轨迹经过处理后的字符串、this["mouseDownCounts"]固定值1this["width"]是图片宽、this["jigsaw”][“style”][“left”]是滑动的距离,而这些值生成的地方分别在onMouseMove、onMouseMoving方法中,其中轨迹可以暂时写死,通过滑块距离模拟出来就行,在扣代码时候会发现很多和cb一样的函数,这时候可以直接在getCb.js中扣代码,这里为了更好识别文件可以把getCb.js换成getCorePar.js,需要注意的是扣代码时要确定已经在getCb.js扣过的函数是否和正在扣的一样,如果函数名一样,就要确定函数内部逻辑是否不同,如果不一样需要重新命名歌函数名,避免和之前的冲突
    2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python
七、计算距离与轨迹
  1. 距离计算:可采用PIL、opencv等库,也可以自己搞个训练模型
  2. 距离计算:https://github.com/sml2h3/ddddocr,可使用ddddocr开源库
  3. 距离计算:https://zhuce.jfbym.com,可以使用打码平台,如:云码
  4. 轨迹计算,要模拟轨迹,轨迹中包含移动距离x、鼠标上下偏移y、移动时间,拖动的大概过程:开始拖动的时候一般速度会很快,越接近目标点会越慢,而且到最后可能还有细小的移动调整,在松开手的时候也许会出现停顿的情况,这时候的x是一样的;按照这个思路写代码即可,最好能找几组验证成功的数据使用折线图表现出来更直观些,时间为x轴,移动的距离为y轴;下面是我自己写的一个,虽然轨迹虽然不是太相似,但是能验证通过
import ddddocr
import random
from matplotlib import pyplot

slide = ddddocr.DdddOcr(det=False, ocr=False)


def get_dis():
    with open('./img/yd_front.jpg', 'rb') as f:
        target_bytes = f.read()

    with open('./img/yd_bg.jpg', 'rb') as f:
        background_bytes = f.read()

    res = slide.slide_match(target_bytes, background_bytes, simple_target=True)
    return res['target'][0]


def get_track(dis=0):
    dis = dis or get_dis()
    track = []
    x = random.randint(0, 10)  # 移动X坐标
    y = random.randint(-5, 5)  # 移动y坐标
    pass_time = random.randint(10, 90)  # 移动时间
    move_dis = x  # 移动距离
    track.append([x, y, pass_time])

    # 模拟开始拖动时会产生0-3个类似的x相同的轨迹
    for _ in range(random.randint(0, 3)):
        pass_time += random.randint(2, 5)  # 移动时间
        y = random.randint(-1, 1)
        track.append([x, y, pass_time])

    # 开始模拟轨迹,一般开始拖动时会很快,越接近目标点越慢
    while move_dis < dis:
        if move_dis > dis * 0.95:
            offset = random.randint(-1, 1)  # 模拟快到目标点时调整滑块时的轨迹,一般会左右移动几下对齐
        elif move_dis > dis * 0.85:
            offset = random.randint(0, 1)
        elif move_dis > dis * 0.75:
            offset = random.randint(1, 2)
        elif move_dis > dis * 0.6:
            offset = random.randint(2, 4)
        else:
            offset = random.randint(5, 8)

        pass_time += random.randint(30, 48)
        move_dis += offset
        y = random.choice([y, random.randint(-5, 5)])  # 移动y坐标
        track.append([move_dis, y, pass_time])

    # 模拟停止时会产生0-3个类似的x相同的轨迹
    for _ in range(random.randint(0, 3)):
        pass_time += random.randint(2, 5)  # 移动时间
        y = random.randint(-1, 1)
        track.append([move_dis, y, pass_time])

    return track, dis


def draw_line_chart(track):
    x_axis = [info[2] for info in track]
    y_axis = [info[0] for info in track]
    pyplot.plot(x_axis, y_axis)
    pyplot.show()


if __name__ == '__main__':
    # test_track = {
    #     260: [[4, 3, 8], [4, 3, 14], [4, 4, 23], [6, 5, 30], [6, 6, 38], [8, 7, 46], [9, 7, 54], [11, 8, 63],
    #           [13, 9, 68],
    #           [19, 9, 78], [24, 10, 84], [32, 10, 95], [40, 10, 100], [48, 9, 109], [60, 7, 117], [72, 4, 125],
    #           [84, 3, 134],
    #           [98, 0, 139], [112, -2, 147], [124, -3, 154], [136, -5, 164], [145, -5, 170], [155, -6, 179],
    #           [161, -6, 186],
    #           [167, -7, 196], [169, -7, 202], [171, -7, 209], [172, -8, 217], [174, -8, 225], [175, -8, 234],
    #           [177, -9, 241],
    #           [181, -9, 250], [187, -9, 257], [194, -9, 265], [202, -11, 272], [210, -11, 280], [218, -11, 286],
    #           [224, -11, 296], [230, -11, 302], [234, -11, 312], [237, -11, 318], [238, -11, 328], [239, -11, 335],
    #           [240, -11, 341], [240, -11, 467], [244, -11, 475], [245, -11, 480], [246, -11, 497], [248, -11, 641],
    #           [248, -9, 648], [249, -9, 657], [251, -8, 664], [252, -8, 676], [252, -7, 777], [253, -7, 789],
    #           [254, -7, 796],
    #           [256, -6, 1061], [256, -6, 1077], [257, -6, 1172], [258, -6, 1180], [259, -6, 1817], [260, -6, 1826],
    #           [260, -6, 1835]],
    #     197: [[5, -2, 68], [9, -3, 75], [13, -4, 83], [19, -4, 89], [24, -4, 99], [31, -4, 106], [36, -4, 115],
    #           [44, -5, 122], [53, -6, 131], [61, -6, 139], [87, -9, 173], [92, -10, 175], [94, -10, 183],
    #           [96, -10, 190],
    #           [99, -11, 198], [100, -11, 206], [102, -11, 213], [104, -11, 221], [105, -11, 229], [108, -11, 237],
    #           [110, -11, 245], [112, -11, 254], [116, -11, 261], [119, -11, 268], [120, -11, 276], [122, -11, 283],
    #           [124, -11, 291], [124, -11, 300], [125, -11, 307], [126, -11, 315], [127, -11, 335], [128, -11, 348],
    #           [129, -11, 356], [131, -12, 365], [135, -12, 372], [140, -12, 381], [146, -12, 388], [152, -12, 397],
    #           [157, -13, 405], [161, -13, 413], [164, -13, 420], [166, -13, 427], [168, -14, 435], [168, -15, 510],
    #           [169, -16, 522], [171, -16, 530], [172, -16, 538], [172, -16, 547], [172, -16, 554], [173, -16, 562],
    #           [174, -17, 634], [175, -17, 645], [176, -17, 655], [176, -17, 662], [176, -18, 671], [178, -18, 678],
    #           [179, -18, 686], [180, -18, 693], [182, -18, 701], [183, -18, 708], [184, -18, 717], [184, -18, 822],
    #           [185, -18, 836], [186, -18, 934], [187, -18, 954], [188, -18, 962], [188, -18, 978], [189, -18, 1001],
    #           [190, -18, 1012], [191, -18, 1070], [192, -18, 1077], [192, -18, 1086], [193, -18, 1093],
    #           [194, -18, 1103],
    #           [195, -18, 1109], [196, -18, 1270], [196, -18, 1581], [197, -18, 1836], [197, -19, 2746],
    #           [197, -20, 2753]],
    #     152: [[6, 0, 50], [9, 0, 58], [15, -1, 67], [20, -2, 76], [26, -4, 82], [34, -5, 89], [40, -6, 96],
    #           [45, -7, 105],
    #           [51, -8, 112], [56, -9, 121], [61, -10, 128], [65, -11, 137], [70, -12, 144], [73, -12, 153],
    #           [77, -13, 157],
    #           [80, -15, 166], [83, -16, 176], [85, -16, 183], [87, -16, 191], [88, -16, 198], [89, -16, 207],
    #           [91, -16, 213],
    #           [92, -16, 226], [92, -16, 256], [96, -16, 264], [100, -16, 272], [105, -16, 279], [111, -16, 290],
    #           [116, -16, 294], [122, -16, 303], [124, -16, 311], [126, -16, 320], [128, -15, 326], [128, -15, 346],
    #           [129, -15, 354], [130, -15, 362], [131, -15, 369], [132, -16, 377], [132, -16, 385], [133, -16, 393],
    #           [134, -16, 442], [137, -17, 462], [143, -18, 471], [148, -18, 478], [153, -18, 487], [159, -18, 493],
    #           [160, -18, 502], [160, -18, 615], [160, -17, 630], [159, -17, 770], [158, -17, 791], [157, -17, 804],
    #           [156, -17, 823], [156, -17, 835], [155, -17, 845], [154, -17, 870], [153, -17, 890], [152, -17, 920],
    #           [152, -18, 932], [151, -18, 940], [150, -18, 972], [151, -18, 1701], [152, -18, 1709], [152, -17, 1828]],
    #     243: [[6, 2, 50], [11, 2, 56], [16, 2, 64], [24, 2, 72], [34, 3, 79], [47, 3, 89], [63, 3, 95], [78, 3, 105],
    #           [92, 3, 112], [104, 2, 120], [115, 1, 128], [123, -1, 132], [129, -2, 145], [135, -3, 150],
    #           [140, -5, 158],
    #           [145, -7, 165], [151, -9, 175], [156, -11, 180], [163, -13, 189], [169, -15, 195], [175, -17, 205],
    #           [182, -19, 212], [187, -20, 220], [193, -21, 229], [198, -21, 236], [200, -22, 245], [202, -22, 252],
    #           [203, -22, 379], [205, -21, 387], [206, -21, 394], [207, -21, 401], [209, -20, 410], [210, -20, 417],
    #           [211, -19, 426], [214, -19, 433], [215, -18, 442], [217, -18, 448], [219, -18, 459], [219, -18, 465],
    #           [220, -18, 471], [221, -18, 482], [222, -18, 624], [223, -18, 648], [223, -18, 655], [225, -18, 663],
    #           [226, -18, 668], [227, -18, 679], [227, -18, 686], [228, -18, 729], [229, -17, 739], [230, -17, 748],
    #           [231, -17, 756], [232, -17, 765], [233, -17, 771], [234, -17, 781], [235, -17, 829], [235, -17, 836],
    #           [235, -16, 844], [237, -16, 852], [238, -16, 867], [238, -15, 875], [239, -15, 952], [239, -15, 972],
    #           [240, -15, 1076], [241, -14, 1304], [242, -13, 1382], [243, -13, 1401]],
    #     146: [[4, 5, 110], [6, 5, 118], [12, 5, 128], [21, 6, 135], [33, 6, 140], [46, 6, 150], [60, 6, 155],
    #           [72, 6, 167],
    #           [84, 6, 173], [94, 5, 182], [100, 5, 189], [105, 4, 198], [107, 4, 205], [108, 4, 210], [110, 3, 221],
    #           [112, 3, 235], [112, 3, 242], [113, 3, 257], [113, 2, 264], [114, 2, 279], [115, 2, 410], [116, 2, 425],
    #           [117, 2, 432], [119, 3, 442], [120, 3, 449], [122, 3, 458], [123, 4, 466], [124, 4, 475], [126, 5, 479],
    #           [127, 5, 488], [129, 5, 495], [131, 5, 504], [132, 5, 511], [134, 5, 520], [136, 5, 527], [136, 5, 535],
    #           [137, 5, 543], [138, 5, 554], [139, 5, 721], [140, 5, 731], [140, 5, 737], [141, 5, 837], [142, 5, 860],
    #           [143, 6, 1017], [144, 6, 1026], [144, 7, 1031], [145, 7, 1118], [146, 7, 1138], [146, 8, 1149],
    #           [147, 8, 1161],
    #           [147, 9, 1199], [148, 9, 1207], [148, 9, 1214], [149, 10, 1231], [148, 10, 1779], [148, 9, 1789],
    #           [148, 9, 1906], [147, 9, 1969], [146, 9, 1976], [146, 9, 1986]],
    #     264: [[4, 0, 41], [5, 0, 48], [12, 1, 57], [21, 1, 66], [33, 1, 74], [53, 1, 80], [75, 1, 88], [100, 3, 95],
    #           [123, 4, 105], [136, 5, 110], [149, 6, 120], [159, 8, 126], [164, 8, 136], [170, 9, 143], [173, 9, 149],
    #           [175, 9, 158], [176, 9, 166], [179, 9, 174], [182, 9, 181], [186, 8, 190], [192, 7, 198], [197, 4, 207],
    #           [203, 4, 210], [208, 4, 221], [212, 4, 227], [214, 3, 236], [215, 3, 242], [216, 3, 251], [217, 3, 258],
    #           [219, 3, 268], [220, 3, 273], [223, 3, 283], [226, 3, 290], [230, 3, 297], [233, 3, 307], [236, 3, 314],
    #           [238, 3, 321], [240, 3, 328], [240, 3, 338], [240, 2, 407], [242, 2, 412], [244, 1, 420], [244, 1, 428],
    #           [245, 1, 437], [246, 0, 528], [247, 0, 587], [248, 0, 595], [250, 1, 610], [251, 1, 617], [252, 2, 705],
    #           [252, 2, 712], [253, 3, 721], [254, 3, 833], [256, 4, 911], [256, 4, 922], [256, 4, 931], [257, 4, 1071],
    #           [258, 4, 1073], [258, 5, 1075], [259, 5, 1077], [260, 5, 1127], [260, 5, 1151], [261, 6, 1227],
    #           [262, 7, 1236],
    #           [263, 8, 1244], [264, 8, 1254], [264, 8, 1260]],
    #     133: [[8, 0, 75], [16, 0, 83], [24, 0, 93], [33, 0, 101], [44, -2, 108], [53, -3, 118], [61, -5, 124],
    #           [70, -6, 130],
    #           [76, -8, 142], [81, -10, 145], [87, -12, 154], [92, -14, 160], [97, -16, 167], [102, -17, 176],
    #           [106, -19, 184], [108, -20, 192], [111, -20, 200], [112, -21, 206], [112, -22, 214], [113, -22, 221],
    #           [114, -22, 250], [115, -22, 258], [116, -23, 265], [117, -23, 272], [118, -23, 288], [119, -23, 358],
    #           [120, -23, 376], [120, -23, 454], [121, -23, 465], [123, -23, 472], [124, -22, 480], [125, -22, 487],
    #           [126, -22, 640], [127, -21, 655], [128, -20, 759], [128, -20, 771], [129, -20, 779], [130, -20, 853],
    #           [131, -19, 869], [132, -19, 891], [132, -18, 932], [133, -18, 939], [133, -17, 947], [134, -17, 954],
    #           [135, -16, 961], [136, -16, 971], [135, -16, 1514], [135, -17, 1521], [134, -18, 1565], [134, -19, 1587],
    #           [133, -19, 1596]],
    #     153: [[5, 1, 45], [10, 1, 54], [17, 1, 63], [25, 1, 70], [33, 1, 78], [41, -2, 87], [49, -3, 94], [57, -4, 103],
    #           [66, -7, 108], [74, -7, 118], [80, -9, 125], [85, -10, 133], [91, -11, 141], [96, -12, 149],
    #           [98, -12, 157],
    #           [101, -13, 165], [104, -13, 173], [106, -14, 179], [108, -15, 187], [110, -15, 194], [112, -15, 204],
    #           [113, -15, 211], [115, -15, 219], [117, -15, 226], [117, -15, 236], [119, -15, 242], [120, -15, 250],
    #           [121, -16, 256], [121, -16, 265], [122, -16, 276], [123, -16, 286], [125, -16, 291], [128, -17, 302],
    #           [132, -17, 309], [137, -18, 315], [144, -19, 324], [149, -19, 331], [155, -19, 340], [158, -19, 347],
    #           [159, -19, 356], [160, -19, 371], [158, -19, 635], [157, -19, 642], [157, -19, 649], [156, -19, 656],
    #           [155, -19, 674], [155, -20, 945], [154, -21, 960], [153, -22, 972], [153, -22, 1060]],
    #     226: [[8, 2, 49], [15, 4, 58], [23, 4, 65], [31, 4, 73], [39, 4, 80], [47, 4, 90], [57, 3, 97], [65, 3, 106],
    #           [73, 1, 113], [81, -1, 122], [89, -3, 129], [97, -5, 136], [103, -7, 143], [110, -9, 150],
    #           [117, -11, 160],
    #           [125, -13, 167], [130, -15, 176], [136, -17, 183], [143, -18, 193], [150, -19, 198], [155, -19, 205],
    #           [160, -21, 214], [161, -21, 222], [161, -21, 229], [162, -21, 273], [164, -21, 292], [168, -22, 297],
    #           [173, -23, 308], [177, -23, 315], [181, -23, 323], [183, -23, 330], [185, -23, 337], [186, -23, 346],
    #           [187, -23, 353], [188, -23, 403], [189, -24, 414], [190, -24, 424], [191, -24, 430], [193, -24, 440],
    #           [193, -24, 450], [195, -24, 455], [197, -25, 462], [199, -25, 471], [201, -25, 475], [205, -25, 484],
    #           [206, -26, 493], [209, -26, 500], [210, -26, 509], [211, -26, 591], [213, -26, 602], [213, -27, 621],
    #           [214, -27, 628], [215, -27, 694], [216, -27, 702], [217, -27, 749], [217, -27, 764], [219, -27, 773],
    #           [220, -27, 789], [221, -27, 796], [222, -26, 995], [223, -25, 1263], [224, -25, 1283], [225, -25, 1290],
    #           [225, -24, 1793], [225, -23, 1800], [225, -23, 1808], [226, -23, 2165]],
    #     189: [[5, 2, 86], [13, 2, 97], [22, 3, 104], [33, 3, 113], [44, 3, 118], [54, 3, 123], [66, 4, 132],
    #           [74, 4, 142],
    #           [80, 4, 148], [85, 4, 157], [88, 4, 164], [88, 5, 174], [90, 5, 180], [91, 5, 187], [92, 5, 204],
    #           [95, 4, 211],
    #           [99, 4, 218], [104, 3, 227], [109, 3, 234], [116, 3, 244], [123, 3, 250], [128, 3, 258], [132, 3, 265],
    #           [135, 3, 274], [136, 3, 280], [136, 3, 332], [138, 3, 347], [144, 3, 354], [152, 3, 363], [160, 3, 371],
    #           [165, 3, 380], [167, 4, 389], [168, 5, 392], [168, 6, 553], [170, 6, 561], [171, 6, 568], [172, 6, 575],
    #           [173, 6, 678], [174, 7, 739], [175, 8, 750], [176, 8, 762], [176, 9, 837], [178, 10, 852], [180, 10, 860],
    #           [182, 10, 867], [184, 11, 875], [187, 11, 883], [188, 12, 892], [188, 13, 1070], [189, 13, 1080]]
    # }
    # for track in test_track.values():
    #     draw_line_chart(track)
    track, dis = get_track(260)
    draw_line_chart(track)
八、验证结果

修改yiduSlider.py,验证滑块,其中dt参数是api/v2/getconf请求返回的,token是每次获取验证码api/v3/get时响应返回的。这里就不破解知乎的登录了,有兴趣的可以自己尝试下
2024-01-05 16:40:48 [scrapy.core.engine] info: spider closed (fini shed),python,爬虫,python文章来源地址https://www.toymoban.com/news/detail-810243.html

到了这里,关于爬虫网易易盾滑块及轨迹算法案例:某乎的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • python爬虫之pyppeteer突破滑块验证

    由于Selenium流行已久,现在稍微有点反爬的网站都会对selenium和webdriver进行识别,网站只需要在前端js添加一下判断脚本,很容易就可以判断出是真人访问还是webdriver。 虽然也可以通过中间代理的方式进行js注入屏蔽webdriver检测,但是webdriver对浏览器的模拟操作(输入、点击等

    2024年01月25日
    浏览(41)
  • 〖Python网络爬虫实战㊶〗- 极验滑块介绍(三)

    订阅:新手可以订阅我的其他专栏。免费阶段订阅量1000+ python项目实战 Python编程基础教程系列(零基础小白搬砖逆袭) 说明:本专栏持续更新中,订阅本专栏前必读关于专栏〖Python网络爬虫实战〗转为付费专栏的订阅说明 作者:爱吃饼干的小白鼠。Python领域优质创作者,20

    2024年02月04日
    浏览(64)
  • 爬虫逆向——某建筑市场监管平台的滑块验证码分析

    目录 网址链接: 正文: 一、思路分析 二、图片处理 三、完整代码 aHR0cHM6Ly9nY3htLmh1bmFuanMuZ292LmNuL2RhdGFzZXJ2aWNlLmh0bWw= (bs64解密可见) 注:分步的代码为示例代码,文章最后会给出图像处理部分的完整代码 1、首先看验证码样式,可以看到是个滑块验证,包含一张带缺口的背景

    2024年02月04日
    浏览(49)
  • 爬虫学习(16):selenium自动化测试:人为模拟滑块移动

    场景描述:本次项目是给一个学校的填体温系统,做了一个自动填报工具,遇到了一个滑块,需要模拟移动一下。 这里只对滑块模拟部分代码进行展示,以帮助大家面临这种移动问题的解决。 思想其实很简单,就是模拟人慢慢的拖动。其实有个技术难点是缺口的识别,计算移

    2024年02月16日
    浏览(54)
  • 视频目标检测与轨迹跟踪代码案例

    通过阅读相关文献及测试,找到了一种基于多模板匹配的改进方法,可以对遥感视频卫星中的移动目标进行探测,并绘制其轨迹。根据实验结果发现,可以比较有效的对运动目标进行跟踪。 核心思想比较简单。即通过不同旋转角度的模板同时匹配,在多个结果中,找到相似度

    2023年04月20日
    浏览(42)
  • 企业spark案例 —— 出租车轨迹分析(Python)

    头歌的大数据作业,答案没找着,遂自己整了一份 第1关:SparkSql 数据清洗 任务描述 本关任务:将出租车轨迹数据规整化,清洗掉多余的字符串。 相关知识 为了完成本关任务,你需要掌握:1. 如何使用 SparkSQL 读取 CSV 文件,2. 如何使用正则表达式清洗掉多余字符串。 编程要

    2024年02月03日
    浏览(48)
  • 如何通过drissionpage以及js逆向过字符/滑块/点选/九宫格验证码文章/视频学习案例

    仅供学习交流仅供学习交流仅供学习交流 各种关于drissionpage文章视频案例解决方案合集,解决方案,可以点击作者官方社群文章查看 ;部分内容入门案例看下方, 视频在作者官方文档有教学视频介绍 如下目录内容js逆向部分文字视频也可以到该合集博客点击查看

    2024年04月17日
    浏览(40)
  • APISpace 全国快递物流地图轨迹查询API接口案例代码

    1.全国快递物流地图轨迹查询接口详解 1.1 接口请求 请求方式:POST 请求地址:https://eolink.o.apispace.com/wldtgj1/paidtobuy_api/trace_map 请求头: 标签 必填 说明 X-APISpace-Token 是 鉴权私钥,登陆 APISpace 后在管理后台的[访问控制]页面查看 Authorization-Type 是 鉴权方式,值为:apikey Content

    2024年02月07日
    浏览(41)
  • Java鹰眼轨迹服务 轻骑小程序 运动健康与社交案例

    Java地图专题课 基本API BMapGLLib 地图找房案例 MongoDB 鹰眼轨迹服务概述 鹰眼是一套 轨迹管理服务,提供各端SDK和API供开发者便捷接入 ,追踪所管理的车辆/人员等运动物体。 基于鹰眼提供的接口和云端服务,开发者可以迅速 构建一套完全属于您自己的完整、精准且高性能的轨

    2024年02月13日
    浏览(31)
  • 验证码滑块识别算法 100% 识别 思路简单(附算法 python 代码)

      最开始的识别思路是通过模板来找到这个验证码的滑块图像所在的位置,但是使用下来发现准确率在90%左右一起提不上去,无论怎么优化都无法提高,后来发现了一个奇特的思路可用完美解决这个验证码的问题,思路写在了代码里面,最后返回的结果是需要移动的滑块的左

    2024年02月19日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包