Douban radio hongxin songs and batch download Methods

Source: Internet
Author: User
There are corresponding tutorials in andrewcx logs, but it may be because the Douban page has been revised and cannot be crawled now. I wrote the code again, if you have firefox, please go to the red-hearted page first (make sure you have logged on or cannot enter it). Please open the plug-in Web development tools and paste the code to execute it, the result is displayed in copyright.
 
 
Capture results
Code in the format of "song name-author-album": var tpage = 6; var page = 1; var n = 0; var songNum = 0; $ ("div. copyright "developer.html (" "); for (page = 1; page <= tpage; page ++) {n = (page-1) * 9; var url =" http://douban.fm/mine? Start = "+ n +" & type = liked "; $. ajax ({type: "GET", url: url, async: false, dataType: "html", success: function (html) {songNum + = $ (html ). find ("div. song_info "). length; $ (html ). find ("div. song_info "). each (function (s) {var d = ""; d = $ (this ). find ("p. song_title "). first (). text () + "-" + $ (this ). find ("p. timer mer "). first (). text () + "-" + $ (this ). find ("p. source> "). first (). text () + "<br>"; $ ("div. copyright "pai.html ($ (" div. copyright ").html () + d) ;}); $ (" div. copyright "pai.html ($ (" div. copyright ").html () +" this page collects songs: "+ $ (html ). find ("div. song_info "). length + "<br/> ");}});}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.