爬 4chan.org 的图片哈哈哈 - V2EX
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
cr4fun
V2EX    Python

4chan.org 的图片哈哈哈

  •  
  •   cr4fun 2018-08-01 20:50:54 +08:00 4022 次点击
    这是一个创建于 2641 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/pmthink/get_pic_for_4chan

    用法:

    git clone https://github.com/pmthink/get_pic_for_4chan.git cd get_pic_for_4chan pip3 install -r install.txt python3 get.py 
    8 条回复    2018-08-02 16:14:07 +08:00
    cr4fun
        1
    cr4fun  
    OP
       2018-08-01 21:07:38 +08:00 via iPhone
    你们肯定不是为了爬 diy 频道的图片...
    csx163
        2
    csx163  
       2018-08-02 08:57:14 +08:00
    /gif 不错
    cr4fun
        3
    cr4fun  
    OP
       2018-08-02 09:25:10 +08:00
    @csx163 老司机,666 ~
    wangfei324017
        4
    wangfei324017  
       2018-08-02 10:14:35 +08:00
    收藏
    wangfei324017
        5
    wangfei324017  
       2018-08-02 10:16:01 +08:00
    cyang812
        6
    cyang812  
       2018-08-02 11:16:50 +08:00
    Kimipoker
        7
    Kimipoker  
       2018-08-02 12:11:44 +08:00
    $ python3 get.py
    http://boards.4chan.org/diy/
    Traceback (most recent call last):
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
    File "<string>", line 2, in raise_from
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
    httplib_respOnse= conn.getresponse()
    File "C:\developer\Python36\lib\http\client.py", line 1331, in getresponse
    response.begin()
    File "C:\developer\Python36\lib\http\client.py", line 297, in begin
    version, status, reason = self._read_status()
    File "C:\developer\Python36\lib\http\client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    File "C:\developer\Python36\lib\socket.py", line 586, in readinto
    return self._sock.recv_into(b)
    ConnectionResetError: [WinError 10054] е

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\developer\Python36\lib\site-packages\requests\adapters.py", line 445, in send
    timeout=timeout
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
    File "C:\developer\Python36\lib\site-packages\urllib3\util\retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
    File "C:\developer\Python36\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
    raise value.with_traceback(tb)
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
    File "<string>", line 2, in raise_from
    File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
    httplib_respOnse= conn.getresponse()
    File "C:\developer\Python36\lib\http\client.py", line 1331, in getresponse
    response.begin()
    File "C:\developer\Python36\lib\http\client.py", line 297, in begin
    version, status, reason = self._read_status()
    File "C:\developer\Python36\lib\http\client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    File "C:\developer\Python36\lib\socket.py", line 586, in readinto
    return self._sock.recv_into(b)
    urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'е', None, 10054, None))

    During handling of he above exception, another exception occurred:

    Traceback (most recent call last):
    File "get.py", line 44, in <module>
    get_pic("diy")
    File "get.py", line 31, in get_pic
    get_pics_from_url(channel_url)
    File "get.py", line 16, in get_pics_from_url
    r = requests.get(url)
    File "C:\developer\Python36\lib\site-packages\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
    File "C:\developer\Python36\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
    File "C:\developer\Python36\lib\site-packages\requests\sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
    File "C:\developer\Python36\lib\site-packages\requests\sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
    File "C:\developer\Python36\lib\site-packages\requests\adapters.py", line 495, in send
    raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'е', None, 10054, None))
    cr4fun
        8
    cr4fun  
    OP
       2018-08-02 16:14:07 +08:00
    if you use linux

    you can :

    python3 get2.py
    it so fast
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3394 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 00:09 PVG 08:09 LAX 17:09 JFK 20:09
    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