当前位置:网站首页>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 .
边栏推荐
- 忽略微信设置字体
- Wonderful use of data analysis
- Leetcode 112: path sum
- 点击回到顶部js
- Planning mathematics final simulation exam I
- Nine days later, we are together to focus on the new development of audio and video and mystery technology
- 数学建模——自来水管道铺设问题
- 使用本地缓存+全局缓存实现小型系统用户权限管理
- Process -- user address space and kernel address space
- 【流放之路-第六章】
猜你喜欢

Sigma-DSP-OUTPUT

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

【Golang】- runtime.Goexit()

【流放之路-第七章】

Mysql存储json格式数据

FPGA实现10M多功能信号发生器

Yocto project download and compilation

How to crawl web pages with playwright?

Process -- user address space and kernel address space

Nine days later, we are together to focus on the new development of audio and video and mystery technology
随机推荐
Practical experience of Google cloud spanner
Know that Chuangyu is listed in many fields of ccsip 2022 panorama
【公开课预告】:快手GPU/FPGA/ASIC异构平台的应用探索
给LaTeX公式添加优美的注解;日更『数据科学』面试题集锦;大学生『计算机』自学指南;个人防火墙;前沿资料/论文 | ShowMeAI资讯日报
mobile-picker.js
[netding cup 2020 rosefinch group]nmap
Mathematical modeling -- red wine quality classification
Web crawler API Quick Start Guide
Lm13 morphological quantification momentum period analysis
使用本地缓存+全局缓存实现小型系统用户权限管理
Qt 内存管理小技巧
Mathematical modeling -- the laying of water pipes
[WesternCTF2018]shrine
【流放之路-第三章】
Sigma-DSP-OUTPUT
Sword finger offer special assault edition day 13
Stonedb invites you to participate in the open source community monthly meeting!
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?
The scientific research environment has a great impact on people
leetcode/和大于等于target的连续最短子数组