当前位置:网站首页>Anti crawler mechanism solution: JS code generates random strings locally
Anti crawler mechanism solution: JS code generates random strings locally
2022-07-29 02:06:00 【Gloomy】
This is an article in Python Notes in learning .
May we make progress together .
Problem description
Previous web Generally, there is no anti crawler mechanism on the end , But now we encounter this problem , It's about to cross this mountain , Conquer it .
In the process of learning reptiles , I climbed a dictionary , As a result, people crawled backwards ,error.
{
“errorCode”:50}
Analyze and solve
Let's look at it first “ Review element ”, That is to choose “ Check ”, Shortcut key :Ctrl + Shift + I
choice network, Find the network request for translation , Then check it out Headers
Results found , stay Request URL in , There is one more website “_o”, Generally, delete this item , To avoid anti crawler mechanism .
follow-up
This can indeed run successfully , however , It's not that simple .
In the view Form Data Find out :
Unexpectedly, it has the same translation as before without anti crawler mechanism From Data The content is different , There are a few more , There are also a few items missing .
Two of them are the key signs of anti crawler :
salt : salt ? Encryption function , It's about time , Is the timestamp of system time conversion .
sign: User's signature string , By constant 、 Time stamp 、 The character composition of user translation , There are specific ways to encrypt , Therefore, each translated character corresponds to sign Is not the same .
If you don't want to delete “_o” To solve , We need to understand their anti crawler mechanism , Find the encryption method , So as to deal with anti reptiles ——
Find all of them in the web page source code “JS file ”, Find related The suffix is “fanyi.js” Of ( It's easy to find , Blue link ), After jumping, I got a full page of strange and disordered code .
Copy code to Code formatter In , You can format less strange code .
Search for “salt”, You can see that salt and sign How to define , Crack the encryption principle .
边栏推荐
- Blind separation of speech signals based on ICA and DL
- druid. io index_ Realtime real-time query
- What is the function of data parsing?
- [UE4] replay game playback for ue4.26
- druid. io kill -9 index_ Realtime traceability task
- [7.21-26] code source - [square count] [dictionary order minimum] [Z-type matrix]
- 【流放之路-第六章】
- Make logic an optimization example in sigma DSP - data distributor
- Leetcode 113: path sum II
- Ciscn 2022 central China Misc
猜你喜欢

Wonderful use of data analysis

【云原生与5G】微服务加持5G核心网

使用POI,实现excel文件导出,图片url导出文件,图片和excel文件导出压缩包

DSP vibration seat

LeetCode 练习——剑指 Offer 45. 把数组排成最小的数

Force deduction brush question (1): sum of two numbers

JS timer setinterval clearinterval delayer setTimeout asynchronous animation

StoneDB 邀请您参与开源社区月会!
![What is a proxy server? [2022 guide]](/img/d8/f9ff56608ab42df9127493bc038961.png)
What is a proxy server? [2022 guide]

基于 ICA 与 DL 的语音信号盲分离
随机推荐
Slow storage scheme
leetcode/和为k的连续子数组个数
LM13丨形态量化-动量周期分析
数学建模——带相变材料的低温防护服御寒仿真模拟
Mysql存储json格式数据
动态内存与智能指针
MySQL安装常见报错处理大全
iVX低代码平台系列详解 -- 概述篇(二)
E-commerce keyword research helps data collection
More interesting Title Dynamic Effect
[云原生]微服务架构是什么
Planning mathematics final exam simulation II
忽略微信设置字体
[网鼎杯 2020 朱雀组]Nmap
秘术冬潮烙技能搭配
数学建模——派出所选址
ASCII code table
Force deduction brush question (2): sum of three numbers
The number of consecutive subarrays whose leetcode/ product is less than k
Mathematical modeling - location of police stations