Current location - Music Encyclopedia - QQ Music - How to use Python to crawl songs from NetEase Cloud Music Playlist
How to use Python to crawl songs from NetEase Cloud Music Playlist

1 First, open the web version of NetEase Cloud Music in your browser and click on a playlist.

2. Check the elements of the page in the browser's developer tools (usually press f12 to pop up the tool), select Network, and then select doc to easily find the elements we need.

Note: Steps 3 and 4 of the following two steps are mainly to prevent anti-crawling of the website. After these two steps, you can basically avoid anti-crawling of the website, so if the website you crawl does not If you want to climb in reverse, you can skip these two steps.

3. Check the request method of the web page - get request

4. Check the header

5. Find the tag where the element we need is located in the Response Location (for example: what we want to crawl is songs, we need to find the name of the song and its id information. By observing, we can find that the song name -moon in one of the song lists is in the li of the ul tag with the class name "f-hide" in the a tag of the tag) ~