抓取网易云音乐网页歌单(url)js

var importJs=document.createElement('script')  //在页面新建一个script标签
importJs.setAttribute("type","text/javascript")  //给script标签增加type属性
importJs.setAttribute("src", 'https://code.jquery.com/jquery-3.1.1.min.js') //给script标签增加src属性, url地址为cdn公共库里的
document.getElementsByTagName("head")[0].appendChild(importJs) //把importJs标签添加在页面
$(function(){
	var str=""
	var au=""
	// au = $(".txt").parent().parent().parent().parent().next().children().next().children().next().next().prop("outerHTML")
	// console.log("------"+au+"----------")
	$(".txt").each(function(){
	au = $(this).parent().parent().parent().parent().next().children().next().children().next().next().data("res-author")
	var O_url = $($(this).children()).attr("href")
	var t = ($(this).children().children()).attr("title")
	str+="["+t+" - "+au+"](https://music.163.com"+O_url+")  \n"
	})
	console.log(str)
})

以上是网易云音乐网页版,获取“我的歌单”中所有歌曲名称和 URL 的 js ,可以直接放在控制台使用。


更多内容欢迎访问 lipk.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值