Skip to content

Instantly share code, notes, and snippets.

@yuche
Last active March 17, 2017 18:56
Show Gist options
  • Save yuche/f7f3c3b0bc14517eacc27a065d7c5b19 to your computer and use it in GitHub Desktop.
Save yuche/f7f3c3b0bc14517eacc27a065d7c5b19 to your computer and use it in GitHub Desktop.
网易云音乐排行榜数据
// 打开 http://music.163.com/#/discover/toplist 在控制台运行
// 数据会自动格式化复制
const toplist = $('#toplist')
const list = [...toplist.querySelectorAll('.item')].map(node => {
const nameNode = node.querySelector('.name a')
const name = nameNode.innerHTML
const id = nameNode.getAttribute('href').slice(21)
const meta = node.querySelector('.s-fc4').innerHTML
const imgUrl = node.querySelector('.avatar img').src.slice(0, -12)
return { name, id ,imgUrl , meta }
})
copy(list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment