在爬取 http://real.hffd.gov.cn/index?servicetype= 这个网站时,获取不到每个小区的 url,请问如何获取?
1
glongzh 2017-05-03 10:16:43 +08:00 1
function reurl(a) {
a.href = "/item/" + recode(a.id) } function recode(a) { var n = nscaler(a); var c = SetObjNum(a.length); var d = SetObjNum(a.length); n = parseInt(n) + parseInt(d); var b = $("#iptstamp").val(); b = nscaler(b.toString()); return c + "-" + n + "-" + d + "-" + b } function SetObjNum(n) { var a = ""; for (var i = 0; i < n; i++) a += Math.floor(Math.random() * 10); return a } function nscaler(a) { var b = ""; $.each(a, function(i, e) { switch (e) { case "0": b += "0"; break; case "1": b += "2"; break; case "2": b += "5"; break; case "3": b += "8"; break; case "4": b += "6"; break; case "5": b += "1"; break; case "6": b += "3"; break; case "7": b += "4"; break; case "8": b += "9"; break; case "9": b += "7"; break } }); return b } |
2
yxy2829 OP 受教!
|