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