推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yxy2829
V2EX  ›  Python

爬虫-scrapy-求救

  •  
  •   yxy2829 · May 3, 2017 · 3005 views
    This topic created in 3322 days ago, the information mentioned may be changed or developed.

    在爬取 http://real.hffd.gov.cn/index?servicetype= 这个网站时,获取不到每个小区的 url,请问如何获取?

    4 replies    2017-05-04 09:12:11 +08:00
    glongzh
        1
    glongzh  
       May 3, 2017   ❤️ 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
    }
    yxy2829
        2
    yxy2829  
    OP
       May 3, 2017
    受教!
    wingor
        3
    wingor  
       May 3, 2017
    @glongzh 这段 js 是从哪里得到的?
    glongzh
        4
    glongzh  
       May 4, 2017
    @wingor #3 浏览器 Console
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   832 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 21:19 · PVG 05:19 · LAX 14:19 · JFK 17:19
    ♥ Do have faith in what you're doing.