求助:想抓取这个网页的图片,有什么好办法? - V2EX
请不要在回答技术问题时复制粘贴 AI 生成的内容
androidBrant

求助:想抓取这个网页的图片,有什么好办法?

  •  
  •   androidBrant Aug 1, 2014 5005 views
    This topic created in 4302 days ago, the information mentioned may be changed or developed.
    http://www.szeros-wedding.com/html/service/804.html#1

    里面的图片,帮忙,谢谢。。
    26 replies    2014-08-03 00:24:55 +08:00
    xiandao7997
        1
    xiandao7997  
       Aug 1, 2014 via Android
    Wget
    faceair
        2
    faceair  
       Aug 1, 2014
    http://www.szeros-wedding.com/UpFile/editor/2014032002455418.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002455652.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002456340.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002456480.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002457027.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002457496.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002457996.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002458527.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002458652.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002459152.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002460184.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002460340.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002460512.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002461262.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002461902.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002462480.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002463027.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002463746.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002464809.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002464934.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002465652.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002466230.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002466730.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002466918.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002467590.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002467746.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002468449.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002469090.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002469230.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002469902.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002470699.jpg
    http://www.szeros-wedding.com/UpFile/editor/2014032002470840.jpg

    贴到迅雷应该可以批量下载
    zzetao
        3
    zzetao  
       Aug 1, 2014
    其实一些浏览器的插件可以做到
    androidBrant
        4
    androidBrant  
    OP
       Aug 1, 2014
    @faceair 如何快速抓到这些地址的?
    nealv2ex
        5
    nealv2ex  
       Aug 1, 2014   1
    list = $('.pic img').map(function(o,item){
    var a = document.createElement('a');
    a.href = $(item).attr('original');
    return a.href;
    })
    androidBrant
        6
    androidBrant  
    OP
       Aug 1, 2014
    @xiandao7997

    jiaqiqunaerdeiMac:pic jiaqiqunaer$ wget -r http://www.szeros-wedding.com/UpFile/editor/

    --2014-08-01 14:20:58-- http://www.szeros-wedding.com/UpFile/editor/
    Resolving www.szeros-wedding.com... 211.154.142.215
    Connecting to www.szeros-wedding.com|211.154.142.215|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2014-08-01 14:20:59 ERROR 403: Forbidden.
    NemoAlex
        7
    NemoAlex  
       Aug 1, 2014
    imn1
        9
    imn1  
       Aug 1, 2014   2
    save as...
    complete html
    Roboo
        10
    Roboo  
       Aug 1, 2014
    idm
    xiandao7997
        11
    xiandao7997  
       Aug 1, 2014 via Android
    Wget -r --level=2 --accept=jpg [标题里的 url]
    结束后在子目录的 upfile/editor 里面找
    xiandao7997
        12
    xiandao7997  
       Aug 1, 2014 via Android
    @imn1 感觉自己 《社交网络》白看了
    wesley
        13
    wesley  
       Aug 1, 2014
    先清空浏览器缓存, 再打开那个网页, 再去浏览器缓存文件夹里找
    androidBrant
        14
    androidBrant  
    OP
       Aug 1, 2014
    @faceair 用xpath如何找到这些地址,表达式,谢谢
    mengzhuo
        15
    mengzhuo  
       Aug 1, 2014   1
    再来个python版

    import requests
    from lxml import html
    URL = 'http://www.szeros-wedding.com/html/service/804.html#1'
    [x.attrib['src'] for x in html.fromstring(requests.get('http://www.szeros-wedding.com/html/service/804.html#1').text).xpath('//img')]

    -------

    ['/skins/20140425/images/bg74.gif',
    '/skins/20140425/images/t0.gif',
    '/skins/20140425/images/t3.gif',
    '/skins/20140425/images/t01.gif',
    '/skins/20140425/images/t01.gif',
    '/skins/20140425/images/bg75.gif',
    '/skins/20140425/images/logo.jpg',
    '/skins/20140425/images/bg6.jpg',
    '/skins/20140425/images/bg7.jpg',
    '/skins/20140425/images/bg8.jpg',
    '/skins/20140425/images/bg9.jpg',
    '/skins/20140425/images/bg10.jpg',
    '/skins/20140425/images/f.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002455418.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002455652.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002456340.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002456480.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002457027.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002457496.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002457996.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002458527.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002458652.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002459152.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002460184.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002460340.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002460512.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002461262.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002461902.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002462480.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002463027.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002463746.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002464809.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002464934.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002465652.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002466230.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002466730.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002466918.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002467590.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002467746.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002468449.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002469090.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002469230.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002469902.jpg',
    '/uedior/asp/../../UpFile/editor/2014032002470699.jpg',
    '/ueditor/asp/../../UpFile/editor/2014032002470840.jpg',
    '/skins/20140425/images/f.jpg',
    '/skins/20140425/images/jd.jpg',
    '/skins/20140425/hzjd/1.jpg',
    '/skins/20140425/hzjd/2.jpg',
    '/skins/20140425/hzjd/3.jpg',
    '/skins/20140425/hzjd/4.jpg',
    '/skins/20140425/hzjd/5.jpg',
    '/skins/20140425/hzjd/6.jpg',
    '/skins/20140425/hzjd/7.jpg',
    '/skins/20140425/hzjd/8.jpg',
    '/skins/20140425/hzjd/9.jpg',
    '/skins/20140425/hzjd/10.jpg',
    '/skins/20140425/images/link.jpg',
    '/skins/20140425/images/logo1.jpg']
    zoudm
        16
    zoudm  
       Aug 1, 2014
    @androidBrant

    Xpath:

    /html/body/table/tbody/tr[1]/td/table/tbody/tr[5]/td/div/p[1]/img
    ...
    ...
    /html/body/table/tbody/tr[1]/td/table/tbody/tr[5]/td/div/p[5]/img
    muziyue
        17
    muziyue  
       Aug 1, 2014
    如果不是特别多的页面的话,我一般都是curl+s 然后文件夹里找
    decken
        18
    decken  
       Aug 1, 2014
    decken
        19
    decken  
       Aug 1, 2014
    mopvhs
        20
    mopvhs  
       Aug 2, 2014
    来分享下我的常用方法:



    http://gist.github.com/4b93757c88b5fe558846
    mopvhs
        21
    mopvhs  
       Aug 2, 2014   1
    jprovim
        22
    jprovim  
       Aug 2, 2014
    BGLL
        23
    BGLL  
       Aug 2, 2014
    Chorme 扩展:Fatkun
    androidBrant
        24
    androidBrant  
    OP
       Aug 2, 2014
    果然还是v2人才多,wget命令一下全下来了


    @xiandao7997 给力
    xiandao7997
        25
    xiandao7997  
       Aug 2, 2014 via Android
    保存网页然后去文件夹找那个最简单,21楼的方法也很酷
    run2
        26
    run2  
       Aug 3, 2014
    firefox + downthemall
    About     Help     Advertise     Blog     API     FAQ     Solana     3202 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 75ms UTC 14:36 PVG 22:36 LAX 07:36 JFK 10:36
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86