V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
marchbook
V2EX  ›  Python

怎样用Python 写一个爬图片的程序?

  •  
  •   marchbook · 2013-03-01 17:06:01 +08:00 · 32566 次点击
    这是一个创建于 4046 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我是一名Python初学者,看基础知识到模块,类 ,列表元组字典,还没用过Python 标准库,

    我很喜欢杉本有美大妹子,想从贴吧抓取她的全部写真照,这样就不用一张张右键,我该怎么一步步做呢?求v2ex大大们指点迷津. 抓完了我会放在这里供大家下载.

    http://tieba.baidu.com/p/2166231880
    29 条回复    1970-01-01 08:00:00 +08:00
    spark
        1
    spark  
       2013-03-01 17:08:41 +08:00   ❤️ 3
    去看看以下三个:
    * requests
    * PyQuery
    * Scrapy
    marchbook
        2
    marchbook  
    OP
       2013-03-01 17:20:02 +08:00
    @spark 今晚看 :D
    manoon
        3
    manoon  
       2013-03-01 19:05:10 +08:00
    如果仅此而已。。不需要python

    firefox有个downthemall的插件。。

    其实。。光用BS就足够了哟。以前抓过豆娘的~~~哈哈。
    skydiver
        4
    skydiver  
       2013-03-01 19:18:11 +08:00
    @manoon BS 是什么?
    manoon
        5
    manoon  
       2013-03-01 20:01:40 +08:00
    @skydiver
    Beautiful Soup
    AWSAM
        6
    AWSAM  
       2013-03-01 20:31:54 +08:00
    跑下题.
    右键-使用迅雷下载全部链接-jpg-确定。
    over
    wenbinwu
        7
    wenbinwu  
       2013-03-01 20:37:11 +08:00
    @AWSAM 呵呵,我是想介绍firefox扩展给他的:)
    for4
        8
    for4  
       2013-03-02 01:50:14 +08:00
    for4
        9
    for4  
       2013-03-02 01:50:26 +08:00   ❤️ 1
    linzhi
        10
    linzhi  
       2013-03-02 11:51:16 +08:00
    LZ 赤裸裸的
    marchbook
        11
    marchbook  
    OP
       2013-03-02 16:02:08 +08:00
    大家好,我是撸主,谢谢大家的提点, 写这个东西,一来是为了杉本有美大妹子,二来是训练一下Python技能,撸主想当一条码农.
    Myfreedom614
        12
    Myfreedom614  
       2013-03-02 16:08:34 +08:00   ❤️ 1
    .Net版本的软件我倒是有,python(Github)有很多人写过了 http://openszone.com/tbalbumassistant/
    zhy0216
        13
    zhy0216  
       2013-03-02 16:31:53 +08:00
    这算是为了妹子写程序么? 哈哈~
    marchbook
        14
    marchbook  
    OP
       2013-03-02 17:02:09 +08:00
    @zhy0216 巴扎黑!
    lrz0lrz
        15
    lrz0lrz  
       2013-03-04 13:58:25 +08:00
    imcj
        16
    imcj  
       2013-03-04 14:02:13 +08:00
    linnchord
        17
    linnchord  
       2013-03-04 14:13:00 +08:00
    requests+pyquery +1

    Scrapy复杂了点,小规模玩票不适用。
    xavierskip
        18
    xavierskip  
       2013-03-04 14:16:36 +08:00 via Android
    自己想解决方案嘛!

    不过就是取得页面内容,然后匹配找出说有符合要求的图片url,需要翻页再找到下一页的url。需要用到urllib2和re,麻烦点自己正则匹配,或着其他库方便点。

    我之前写过一抓取虎扑相册图片的脚本。
    marchbook
        19
    marchbook  
    OP
       2013-03-15 23:17:37 +08:00
    @xavierskip 多谢多谢,前段时间做别的事,这才记起来.
    marchbook
        20
    marchbook  
    OP
       2013-03-15 23:29:53 +08:00
    @xavierskip 可否分享一下源码
    marchbook
        21
    marchbook  
    OP
       2013-03-15 23:30:46 +08:00
    @Myfreedom614 咦,python开源版的有没有?
    xavierskip
        22
    xavierskip  
       2013-03-16 00:11:47 +08:00 via Android
    fuckwaytoexplore
        23
    fuckwaytoexplore  
       2013-03-16 00:22:19 +08:00   ❤️ 1
    楼主用的女人图片,站长快点来删了。
    wenLiangcan
        24
    wenLiangcan  
       2013-03-16 17:39:56 +08:00   ❤️ 1
    cooiky
        25
    cooiky  
       2013-03-20 22:03:53 +08:00
    @imcj 邀请码?
    imcj
        26
    imcj  
       2013-03-21 09:14:29 +08:00
    @cooiky 需要邀请码可以联系@sohoer,不保证,XD。
    xiaowangge
        27
    xiaowangge  
       2013-03-27 18:13:33 +08:00
    marchbook
        28
    marchbook  
    OP
       2013-03-27 20:11:22 +08:00
    marchbook
        29
    marchbook  
    OP
       2013-03-27 20:15:33 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2767 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:48 · PVG 20:48 · LAX 05:48 · JFK 08:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.