️ Internship Actual combat scene monk
This blog continues to learn about font anti - crawling , The site involved is internship x, The target site address can be directly searched by Baidu .
You can see that there are many in the source code on the right “ The statement ”, This contains key information .
Then follow the routine , Retrieve font related information in developer tools , But after screening , Didn't get the anti crawl font , only one
file?
There are a few possibilities .
Here is a new scene , If the judgment is not right , That can only be judged by font style and font label name . Search in the web source code
@font-face
and
myFont
, Get the following figure , Here we find
file
The font appears again , It seems that the key to solving the problem has emerged .
No suffix found after downloading the file name , We can make up for one
.ttf
The suffix , Next drag to FontCreator in , Then look it up .![ Dare to see series ?Python The practice monk of the practical case of font anti climbing , Keep digging ](https://img-blog.csdnimg.cn/4230e0cd5c8e47f88e17d53a55503df6.png =600x) After refreshing the page twice , Get another
file
file , Check whether there is any coding change between the two .
Conclusion : Every time a font file is requested , The response obtained is unchanged . Since there is no change , The subsequent font anti crawling actual combat coding becomes simple .
️ Internship Actual code monk
Parsing font files , Get encoding and characters .
from fontTools.ttLib import TTFont
font1 = TTFont('./fonts/file.ttf')
keys,values = [],[]
for k, v in font1.getBestCmap().items():
print(k,v)
The results are as follows .
2 extra bytes in post.stringData array
120 x
57345 uni4E00
57360 uni77
57403 uni56
……
Then let's look at the data returned by the trainee monk site .
-
This involves the conversion of coding .
We got a coded text , As shown below .
 Sales practice 
Next, take a look at the text presented on the page
SaaS Software sales intern
among

The corresponding is
S
character , Take another look at the encoding of this character in the font file , As shown below .
But from the results just now , I didn't get
edb3
Correlation value , But after converting the decimal code , Get the following results .
edb3 There is , Our case has also been completed .
You are reading 【 Dream eraser 】 The blog of Finished reading , You can praise it with a little hand Find the error , Correct it in the direct comment area The second part of the eraser <font color=red>669</font> Original blog