Search

6/24/2013

MatthewMueller/cheerio

MatthewMueller/cheerio - a lightweight html parser with jquery like syntax (find, parent, parents, closest, next, nextAll, prev, prevAll, slice, each, map, filter, first, last, eq)

  request.get(url, (error, rsp, body) ->
    songs = []
    $ = cheerio.load(body)
    songs = $('.track_list .song_name > a:first-child').map( ->
      $(this).attr('href').match(/\d+/)[0]
    )
    console.log('songs', songs)
    getMetaBySongId(songs[0])
  )

via: parsing - HTML-parser on nodejs - Stack Overflow

沒有留言: