网站建设公司词,旗袍网页制作模板,网站开发总结,什么网站都有漏洞前言
嗨喽#xff0c;大家好呀~这里是爱看美女的茜茜呐 课程亮点:
1、爬虫的基本流程
2、反爬的基本原理
3、nodejs的使用
4、抠代码基本思路
环境介绍: python 3.8 pycharm 2022专业版 免费使用教程文末名片获取 requests pip install req…前言
嗨喽大家好呀~这里是爱看美女的茜茜呐 课程亮点:
1、爬虫的基本流程
2、反爬的基本原理
3、nodejs的使用
4、抠代码基本思路
环境介绍: python 3.8 pycharm 2022专业版 免费使用教程文末名片获取 requests pip install requests nodejs
思路流程
apple 请求加密 我们传过去的 内容 经过了一段js加密(在浏览器执行的) 变成了密文 再到服务器 对比 如果对比结果一致 返回内容 响应加密 返回的这个内容 有可能会经过加密(在服务器) 返回给浏览器(我们是能够看到明文/苹果的) 所以在浏览器端 是肯定有解密方法的 我们只需要 找到这个解密方法的来源 把加密方法抠出来本地调用即可
请求是啥样子: 翻译接口的请求
代码展示
import hashlib
import time
import requests
import execjs
import json
import base64f open(demo.js, moder, encodingutf-8).read()
ctx execjs.compile(f)
ts int(time.time() * 1000)
arg1 fclientfanyideskwebmysticTime{ts}productwebfanyikeyfsdsogkndfokasodnaso
完整源码、解答、教程皆VXpytho8987获取记得验证备注“777”
sign hashlib.md5(arg1.encode()).digest().hex()cookies {OUTFOX_SEARCH_USER_ID_NCOO: 1036908156.9092367,OUTFOX_SEARCH_USER_ID: -1116526953175.0.62.184,
}
headers {Accept: application/json, text/plain, */*,Accept-Language: zh-CN,zh;q0.9,Cache-Control: no-cache,Connection: keep-alive,# Requests sorts cookies alphabetically# Cookie: OUTFOX_SEARCH_USER_ID_NCOO1036908156.9092367; OUTFOX_SEARCH_USER_ID-1116526953175.0.62.184,Origin: https://fanyi.youdao.com,Pragma: no-cache,Referer: https://fanyi.youdao.com/,Sec-Fetch-Dest: empty,Sec-Fetch-Mode: cors,Sec-Fetch-Site: same-site,User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36,sec-ch-ua: Not.A/Brand;v8, Chromium;v114, Google Chrome;v114,sec-ch-ua-mobile: ?0,sec-ch-ua-platform: Windows,
}data {i: 苹果,from: auto,to: ,domain: 0,dictResult: true,keyid: webfanyi,sign: sign,client: fanyideskweb,product: webfanyi,appVersion: 1.0.0,vendor: web,pointParam: client,mysticTime,product,mysticTime: ts,keyfrom: fanyi.web,
}
# 完整源码、解答、教程皆VXpytho8987获取记得验证备注“777”
# 应该是在一个时间段内 会进行参数的校验
response requests.post(https://dict.youdao.com/webtranslate, cookiescookies, headersheaders, datadata)
text response.content.decode(utf-8)
json_str ctx.call(deSign, text)
json_data json.loads(base64.b64decode(json_str).decode())
print(json_data)尾语
感谢你观看我的文章呐~本次航班到这里就结束啦
希望本篇文章有对你带来帮助 有学习到一点知识~
躲起来的星星也在努力发光你也要努力加油让我们一起努力叭。 最后宣传一下呀~更多源码、资料、素材、解答、交流皆点击下方名片获取呀