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
limyel
V2EX  ›  Python

请问大家 HTTP 错误代码 418 是什么意思呢

  •  
  •   limyel · 2019-07-07 17:09:10 +08:00 · 27097 次点击
    这是一个创建于 1726 天前的主题,其中的信息可能已经有所发展或是发生改变。

    写爬虫爬微博的时候返回的错误,我搜到是说一个彩蛋...... 但是没看懂什么意思呀,而且为什么会触发 418 呢。

    13 条回复    2019-07-17 13:56:39 +08:00
    lcdtyph
        1
    lcdtyph  
       2019-07-07 17:17:59 +08:00 via iPhone
    因为触发了反爬…
    visualbasic
        2
    visualbasic  
       2019-07-07 23:10:05 +08:00 via Android
    因为你和 618 只差一个 HTTP 200 ……
    lonelinsky
        3
    lonelinsky  
       2019-07-08 01:57:48 +08:00   ❤️ 1
    418 I'm a teapot

    The HTTP 418 I'm a teapot client error response code indicates that the server refuses to brew coffee because it is a teapot. This error is a reference to Hyper Text Coffee Pot Control Protocol which was an April Fools' joke in 1998.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418

    所以就如 1L 所说,你触发了反爬,微博的程序员就返回这个和你开个玩笑 :-)
    ydirel
        4
    ydirel  
       2019-07-08 03:16:45 +08:00
    我是个茶壶
    limyel
        5
    limyel  
    OP
       2019-07-08 09:34:06 +08:00
    @lonelinsky 原来是这样的彩蛋.....
    december
        6
    december  
       2019-07-08 10:07:44 +08:00
    哈哈,看到 418 我就猜到是微博了。
    fank99
        7
    fank99  
       2019-07-08 10:41:59 +08:00
    之前爬其他网站也遇到过 418。。触发反爬了
    dai123456
        8
    dai123456  
       2019-07-08 11:20:37 +08:00
    发爬了,你的 ip 使用的是太多了吗?一种是使用代理,一种是编写个发爬的程序
    limyel
        9
    limyel  
    OP
       2019-07-08 13:58:30 +08:00 via iPhone
    @december 对啊,最近想爬蔡徐坤的粉丝来着😂
    limyel
        10
    limyel  
    OP
       2019-07-08 13:58:55 +08:00 via iPhone
    @december 对啊,最近想爬 cxk 的粉丝来着😂
    limyel
        11
    limyel  
    OP
       2019-07-08 14:00:14 +08:00
    @dai123456 没错,IP 的问题..我今天试试代理
    dai123456
        12
    dai123456  
       2019-07-08 16:43:30 +08:00
    专业爬虫代理,我可以帮你推荐一下
    dai123456
        13
    dai123456  
       2019-07-17 13:56:39 +08:00
    @limyel 专业爬虫代理,我可以帮你推荐一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2716 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 15:33 · PVG 23:33 · LAX 08:33 · JFK 11:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.