• 请不要在回答技术问题时复制粘贴 AI 生成的内容
androidBrant
V2EX  ›  程序员

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

  •  
  •   androidBrant · Aug 1, 2014 · 5427 views
    This topic created in 4489 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
    xiandao7997
    Aug 1, 2014 via Android
    1
    Wget
    faceair
    faceair
    Aug 1, 2014
    2
    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
    zzetao
    Aug 1, 2014
    3
    其实一些浏览器的插件可以做到
    androidBrant
    androidBrant
    OP
    Aug 1, 2014
    4
    @faceair 如何快速抓到这些地址的?
    nealv2ex
    nealv2ex
    Aug 1, 2014❤️1
    5
    list = $('.pic img').map(function(o,item){
    var a = document.createElement('a');
    a.href = $(item).attr('original');
    return a.href;
    })
    androidBrant
    androidBrant
    OP
    Aug 1, 2014
    6
    @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.
    imn1
    imn1
    Aug 1, 2014❤️2
    9
    save as...
    complete html
    Roboo
    Roboo
    Aug 1, 2014
    10
    idm
    xiandao7997
    xiandao7997
    Aug 1, 2014 via Android
    11
    Wget -r --level=2 --accept=jpg [标题里的 url]
    结束后在子目录的 upfile/editor 里面找
    xiandao7997
    xiandao7997
    Aug 1, 2014 via Android
    12
    @imn1 感觉自己 《社交网络》白看了
    wesley
    wesley
    Aug 1, 2014
    13
    先清空浏览器缓存, 再打开那个网页, 再去浏览器缓存文件夹里找
    androidBrant
    androidBrant
    OP
    Aug 1, 2014
    14
    @faceair 用xpath如何找到这些地址,表达式,谢谢
    mengzhuo
    mengzhuo
    Aug 1, 2014❤️1
    15
    再来个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',
    '/ueditor/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
    zoudm
    Aug 1, 2014
    16
    @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
    muziyue
    Aug 1, 2014
    17
    如果不是特别多的页面的话,我一般都是curl+s 然后文件夹里找
    decken
    decken
    Aug 1, 2014
    18
    decken
    decken
    Aug 1, 2014
    19
    mopvhs
    mopvhs
    Aug 2, 2014
    20
    来分享下我的常用方法:



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


    @xiandao7997 给力
    xiandao7997
    xiandao7997
    Aug 2, 2014 via Android
    25
    保存网页然后去文件夹找那个最简单,21楼的方法也很酷
    run2
    run2
    Aug 3, 2014
    26
    firefox + downthemall
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3493 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 05:35 · PVG 13:35 · LAX 21:35 · JFK 00:35
    ♥ Do have faith in what you're doing.