What is the motivation of our learning crawler?
Someone may say: If I learn, I can find a high-paying job.
One might say: I learn to program and hope to contribute to society (manual comedy)
Someone might say, "for the sake of the sister!"
.....
In fact, we will find that sister is the first productivity Ah!
Today we are crawling today's headlines, and you're asking me why I climbed today's headlines? Is it because of love?
Is it because of responsibility?
No, because there are a lot of beautiful pictures in the headlines, and then we can crawl them all down!!!
is not to think that all feel very excited, is not all have to bleed nosebleed?!
All we have to do is to climb down the picture above.
Start Analysis site
Press F12, and then click Network to refresh the below you can see these
On the Web page, you can see that the picture will show more pictures as you drop the page.
The site of today's headlines is dynamically loaded and can be easily found in xhr files.
Continue to send requests, click on this request to see what data is returned
Can see this is a JSON, there is a picture URL, this is what we are looking for.
We can use the JSON library to parse, and this site is a GET request, so you can use the requests library to send and then parse it, very simple.
Code: Need complete code attention forwarding, add my QQ group: 836962007 can get!
Finally, I'll show you the results.
The above article, if there is a mistake welcome in the message area, if this article is useful to you, a praise, turn a hair how?
All right, give us this article on the Welfare Plus I QQ group: 836962007 can get Oh!
Like and use Python to get today's headlines above 3,000 beauties chart, and see tutorial