开始我学习爬虫的目标 ----> 煎蛋网

通过设置User-Agent获取网页,发现本该是图片链接的地方被一个js函数代替了

于是全局搜索到该函数

function jandan_load_img(b){
    var d = $(b);
    var f = d.next("span.img-hash");
    var e = f.text();
    f.remove();
    var c = jdPwA5ybKhQWGy2rZybAF2StIBxrQ6NvYC(e, "pAqWmGD1GsmY5kVokg1a2eyQ3Shj1Usq");
    var a = $('<a href = "'+c.replace(/(\/\/\w+\.sinaimg\.cn\/)(\w+)(\/.+\.(gif|jpg|jpeg))/, "$1large$3")+'" target = "_blank" class = "view_img_link">[查看原图]</a>');
    d.before(a);
    d.before("<br>");
    d.removeAttr("onload");
    d.attr("src", location.protocol+c.replace(/(\/\/\w+\.sinaimg\.cn\/)(\w+)(\/.+\.gif)/, "$1thumb180$3"));
    if(/\.gif$/.test(c)){
        d.attr("org_src", location.protocol+c);
        b.onload = function(){
            add_img_loading_mask(this, load_sina_gif)
        }
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2021-06-19
  • 2021-12-11
  • 2021-06-21
  • 2021-11-02
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2021-04-24
相关资源
相似解决方案