Write it at the front
I saw it on my love cracking forum a long time ago 【 Homo erectus 】Web End crawler attack and defense competition , When I entered their official website , The game is over . It's interesting to look at those topics , But for various reasons, I have never had the opportunity to do those problems . I've been relatively idle recently , I went to open the ape man learning official website and had a look , Trying to finish the first question ---JS confusion [ The source code is garbled ]
""" Of course, I'm learning Python It's going to be difficult , There is no good learning material , How to learn ? Study Python If you don't understand, it is recommended to join the communication group number :928946953 There are like-minded partners in the group , Help each other , There are good video tutorials and PDF! And Daniel's answer ! """

subject

I'll brush the title
Grab all (5 page ) The price of the air ticket , And calculate the average of all ticket prices , Fill in the answer .
The title looks very simple , Is to grab the ticket price , And calculate the average , But when we open the developer debugging tool , You'll encounter the first pit
Close the breakpoint
When we open the debugging tool , A page will pop up

This is a debug The breakpoint , Will block our subsequent operations , But it doesn't matter , It's easy to turn it off

View data sources
next , We click 【Network】, Press ctrl+f5 Refresh web page , There will be blocking operations again , We still click the arrow symbol just now , You can solve it


next , We go back to 【Network】, Click on 【XHR】, You'll find one more message
as for , Why click 【XHR】 Instead of clicking somewhere else ; It's also very simple , You check this page a little , You will find , The price of the air ticket is through XHR Request to get
Some friends may have to ask , What is? XHR request , You can read this article XHR request
Come back to , Let's take a look at the extra message

View this message Header, Discover its URL It is interesting to , Especially where blue lines are drawn , We don 't care here , Let's take a look at Preview
That's even more interesting , As we expected , The price of air tickets is included in this

analysis URL
Links and data have been found , Let's go to the link just now ( After a while ), Of course, I made a mistake
{"error": "token failed"}
JavaScript
Copy
Let's take a look at this link
http://match.yuanrenxue.com/api/match/1?m=f289e3140053a9320c137b67e8723ba3%E4%B8%A81608971657
Students who often write about reptiles will find , The following number string 【1608971657】, It must be a timestamp
in other words , To access this link normally, get the data , Be sure to have a normal timestamp
that , What is a normal timestamp , It must be related to the previous string (m=
f289e3140053a9320c137b67e8723ba3%E4%B8%A8)
We continue to refresh the page , Find out 【m=...】 The strings inside are changing over time , only [%E4%B8%A8] It hasn't changed
[%E4%B8%A8], I think you should be familiar with this as long as you have used Baidu search , It's through UrlEncode Deal with it , We just need to decode to know [%E4%B8%A8] What's it like to arrive
We are here , Webmaster Tools , Decode it

It's easy , We got its value ------> 丨 ( Yes, it's such a Chinese symbol )
Look for the symbol
According to the tips of the topic [js confusion The source code is garbled ], We can think of a very clear idea , Is to find the source code 丨
Back to the page , Right click , Click on [ View page source code ]
Press crtl+F , Search Symbol , Will find the only code
Take a closer look at the code , Found it written in script In the label
We will take the whole script Copy the label , To notepad++ Open it inside
<script>window.url='/api/match/1';request=function(){var timestamp=Date.parse(new Date()) + 100000000;var m=oo0O0(timestamp.toString())+window.f;var list={"page":window.page,"m":m+' 丨 '+timestamp/1000};$.ajax({url:window.url,dataType:"json",async:false,data:list,type:"GET",beforeSend:function(request){},success:function(data){data=data.data;let html='';let us_sign=`<div class="b-airfly"><div class="e-airfly"data-reactid=".1.3.3.2.0.$KN5911.0"><div class="col-trip"data-reactid=".1.3.3.2.0.$KN5911.0.0"><div class="s-trip"data-reactid=".1.3.3.2.0.$KN5911.0.0.0"><div class="col-airline"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0"><div class="d-air"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0"><div class="air"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.0"><span data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.0.1"> United Airlines of China </span></div><div class="num"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.1"><span class="n"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.1.0">KN5911</span><span class="n"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.1.1"> Boeing 737( in )</span><noscript data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.0:$0.1.2"></noscript></div></div><noscript data-reactid=".1.3.3.2.0.$KN5911.0.0.0.0.1"></noscript></div><div class="col-time"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1"><div class="sep-lf"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.0"><h2 data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.0.0">13:50</h2><p class="airport"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.0.1"><span data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.0.1.0"> Daxing International Airport </span><span data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.0.1.1"></span></p></div><div class="sep-ct"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.1"><div class="range"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.1.0">3 Hours 40 minute </div><div class="line"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.1.1"></div></div><div class="sep-rt"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.2"><noscript data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.2.0"></noscript><h2 data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.2.1">17:30</h2><p class="airport"data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.2.2"><span data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.2.2.0"> Bao'an Airport </span></p></div><noscript data-reactid=".1.3.3.2.0.$KN5911.0.0.0.1.3"></noscript></div></div></div><div class="col-price"data-reactid=".1.3.3.2.0.$KN5911.0.1"><p class="prc"data-reactid=".1.3.3.2.0.$KN5911.0.1.0"><span data-reactid=".1.3.3.2.0.$KN5911.0.1.0.0"><i class="rmb"data-reactid=".1.3.3.2.0.$KN5911.0.1.0.0.0">¥</i><span class="fix_price"data-reactid=".1.3.3.2.0.$KN5911.0.1.0.0.1"><span class="prc_wp"style="width:48px">price_sole</span></span></span></p><div class="vim"data-reactid=".1.3.3.2.0.$KN5911.0.1.1"><span class="v dis"data-reactid=".1.3.3.2.0.$KN5911.0.1.1.$0"></span></div></div><div class="col-fold"data-reactid=".1.3.3.2.0.$KN5911.0.2"><p class="fd"data-reactid=".1.3.3.2.0.$KN5911.0.2.0"> Retract </p></div></div><noscript data-reactid=".1.3.3.2.0.$KN5911.1"></noscript></div>`;let choice=[' China Southern Airlines ',' Lucky air ',' Okay air ',' Nine yuan air ',' Long Dragon Airlines ',' Eastern airlines ',' Air China ',' Shenzhen Airlines ',' Hainan Airlines ',' Spring airlines ',' Shanghai Airlines ',' Western Airlines ',' Chongqing Airlines ',' Tibet Airlines ',' United Airlines of China ',' Yunnan Xiangpeng airlines ',' Yunnan ying'an airlines ',' Xiamen Airlines ',' Tianjin Airlines ',' Shandong Airlines ',' Sichuan Airlines ',' China airlines ',' Great Wall Airlines ',' Chengdu Airlines has ',' Beijing Capital Airlines ',' Air China ',' Italian National Airlines ',' India Baijie Airlines ',' Vietnam Air ',' Far East Airlines ',' Air India ',' Jet Air India Ltd ',' Air Israel ',' Air Italia ',' Iran airlines ',' Eagle Air Indonesia ',' British Airways ',' Western Sky Airlines ',' Seagate ',' Spanish European Airlines ',' Spanish Airlines ',' China Southern Airlines ',' Lucky air ',' Okay air ',' Nine yuan air ',' Long Dragon Airlines ',' Eastern airlines ',' Air China ',' Shenzhen Airlines ',' Hainan Airlines ',' Spring airlines ',' Shanghai Airlines ',' Western Airlines ',' Chongqing Airlines ',' Tibet Airlines ',' United Airlines of China ',' Yunnan Xiangpeng airlines ',' Yunnan ying'an airlines ',' Xiamen Airlines ',' Tianjin Airlines ',' Shandong Airlines ',' Sichuan Airlines ',' China airlines ',' Great Wall Airlines ',' Chengdu Airlines has ',' Beijing Capital Airlines ',' Air China ',' Italian National Airlines ',' India Baijie Airlines ',' Vietnam Air ',' Far East Airlines ',' Air India ',' Jet Air India Ltd ',' Air Israel ',' Air Italia ',' Iran airlines ',' Eagle Air Indonesia ',' British Airways ',' Western Sky Airlines ',' Seagate ',' Spanish European Airlines ',' Spanish Airlines '];let op=1; let jic=[' Beijing Capital International Airport ',' Shanghai Hongqiao International Airport ',' Shanghai Pudong International Airport ',' Tianjin Binhai International Airport ',' Taiyuan Wusu Airport ',' Hohhot Baita Airport ',' Shenyang Taoxian International Airport ',' Dalian Zhoushuizi International Airport ',' Changchun Dafangshen Airport ',' Harbin Yanjiagang International Airport ',' Qiqihar Sanjiazi Airport ',' Jiamusi east suburb Airport ',' Xiamen Gaoqi International Airport ',' Fuzhou Changle International Airport ',' Hangzhou Xiaoshan International Airport ',' Hefei Luogang Airport ',' Ningbo Lishe airport ',' Nanjing Lukou International Airport ',' Guangzhou Baiyun International Airport ',' Shenzhen Bao'an International Airport ',' Changsha Huanghua Airport ',' Haikou Meiya Airport ',' Wuhan Tianhe Airport ',' Jinan Yaoqiang airport ',' Qingdao Liuting Airport ',' Nanning Wuxu Airport ',' Sanya Phoenix International Airport ',' Chongqing Jiangbei International Airport ',' Chengdu Shuangliu International Airport ',' Kunming Wujiaba International Airport ',' Kunming Changshui International Airport ',' Guilin Liangjiang International Airport ',' Xian Xianyang International Airport ',' Lanzhou Zhongchuan airport ',' Guiyang Longdongbao airport ',' Lhasa Gongga Airport ',' Urumqi diwobao airport ',' Nanchang Xiangtang Airport ',' Zhengzhou Xinzheng airport ',' Beijing Capital International Airport ',' Shanghai Hongqiao International Airport ',' Shanghai Pudong International Airport ',' Tianjin Binhai International Airport ',' Taiyuan Wusu Airport ',' Hohhot Baita Airport ',' Shenyang Taoxian International Airport ',