Created
April 13, 2016 10:27
-
-
Save huanggm/d57bc135bffa2bb086d6ff96a6458617 to your computer and use it in GitHub Desktop.
抓取京东左侧列表数据,返回一个数组
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=$('.subitems').map(function() { | |
return $(this).find('dl').map(function() { | |
var res = {}, $this = $(this); | |
var name = $this.children('dt').text().slice(0, -1); | |
res[name] = $this.children('dd').children('a').map(function() { return $(this).text(); }).get(); | |
return res; | |
}).get(); | |
}).get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment