当前位置:网站首页>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 .
边栏推荐
- 数学建模——派出所选址
- How companies make business decisions -- with the help of data-driven marketing
- Sigma-DSP-OUTPUT
- The solution of reducing the sharpness of pictures after inserting into word documents
- 忽略微信设置字体
- As long as I run fast enough, it won't catch me. How does a high school student achieve a 70% salary increase under the epidemic?
- 数学建模——仓内拣货优化问题
- [WesternCTF2018]shrine
- LM13丨形态量化-动量周期分析
- Come on, handwritten RPC S2 serialization exploration
猜你喜欢

Nine days later, we are together to focus on the new development of audio and video and mystery technology

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

Using local cache + global cache to realize user rights management of small systems

Leetcode exercise - Sword finger offer 45. arrange the array into the smallest number

数学建模——永冻土层上关于路基热传导问题

【流放之路-第七章】

数学建模——派出所选址

E-commerce keyword research helps data collection

Yocto project download and compilation

动态内存与智能指针
随机推荐
Monadic linear function perceptron: Rosenblatt perceptron
Talk about possible problems when using transactions (@transactional)
Come on, handwritten RPC S2 serialization exploration
Web crawler API Quick Start Guide
[the road of Exile - Chapter 2]
druid. The performance of IO + tranquility real-time tasks is summarized with the help of 2020 double 11
Golang startup error [resolved]
Use of packet capturing tool Charles
(arxiv-2018) reexamine the time modeling of person Reid based on video
【流放之路-第八章】
As long as I run fast enough, it won't catch me. How does a high school student achieve a 70% salary increase under the epidemic?
Slow storage scheme
Mathematical modeling -- heat conduction of subgrade on Permafrost
移动通信——基于卷积码的差错控制系统仿真模型
Planning mathematics final exam simulation II
Mathematical modeling -- bus scheduling optimization
Random talk on distributed development
JS timer setinterval clearinterval delayer setTimeout asynchronous animation
MPEG音频编码三十年
Mathematical modeling - location of police stations