In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how python crawls Baidu music data. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
First of all, we need to get the address of each playlist. Let's start with the home page of Baidu Music's playlist:
The red box in the picture is the current number of playlists. There are 20 playlists on each page, that is, 20 URL. We extract them:
After storing it in the database, you have the following results:
(partial screenshot)
With the URL address of the playlist, let's visit:
The inside page of a playlist is like this. Here, we only extract the information in the red box, that is, the name of the playlist, the creator of the playlist, the label of the playlist, the number of times the playlist is played, the title of the songsong, the singer and the album.
Press F12 on the web page to open the debugging tool, find the location of the above information, and match it.
Finally, use multi-thread or multi-process to call the function.
A total of more than 5000 songs with a total of 100000 songs have been crawled. Some screenshots are as follows:
Thank you for reading! This is the end of the article on "how python crawls Baidu Music data". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.