首页
首页

批量获取京东分类信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var linum = document.querySelector('#branchList').getElementsByTagName("li").length
var start = 645
var text =""

for (let index = 0; index < linum; index++) {

var index2 = index + start

var branch = "branch_" + index2
var h4 = document.getElementById(branch).parentNode.parentNode.parentNode.querySelector("h4").innerText
var img = document.getElementById(branch).querySelector("img").src
var span = document.getElementById(branch).querySelector("span").innerText

text = text+ "\n" +index + " "+img + " " + span+ " " +h4

}

console.log(text)