推荐学习书目
› 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
wsds
V2EX  ›  Python

爬虫程序爬着爬着就假死了,也不抛异常,就一直卡在那里,怎么搞

  •  
  •   wsds · Apr 17, 2018 · 9159 views
    This topic created in 3130 days ago, the information mentioned may be changed or developed.
    21 replies  •  2018-04-18 12:46:40 +08:00
    deloved
    deloved
    Apr 17, 2018
    1
    设置 timeout ?
    wcsjtu
    wcsjtu
    Apr 17, 2018
    2
    多 print, 看卡在哪了。。。
    crisewng
    crisewng
    Apr 17, 2018
    3
    你代码也不发 让我们怎么猜。。。。
    John60676
    John60676
    Apr 17, 2018❤️10
    4
    接楼上,我猜是爬虫累了
    PythonAnswer
    PythonAnswer
    Apr 17, 2018 via iPhone
    5
    栈溢出
    xrlin
    xrlin
    Apr 17, 2018❤️1
    6
    爬虫:爬了这么久,是该歇歇了。
    onepunch
    onepunch
    Apr 17, 2018
    7
    多线程死锁?
    lan5635
    lan5635
    Apr 17, 2018
    8
    服务器被你爬趴下了?
    lusi1990
    lusi1990
    Apr 17, 2018 via Android
    9
    阻塞了, 链接池释放了吗,设置 timeout 了吗
    jimmyczm
    jimmyczm
    Apr 17, 2018
    10
    可能虫子被小鸟吃了
    yxwzaxns
    yxwzaxns
    Apr 17, 2018 via iPhone
    11
    开 ssh,我去看看
    Ginson
    Ginson
    Apr 17, 2018
    12
    很大可能是请求阻塞了
    hhvv23911k
    hhvv23911k
    Apr 17, 2018
    13
    爬虫:我休息一下不行?换你一直爬试试?
    dengshuang
    dengshuang
    Apr 17, 2018
    14
    用 print 方法检查,那个地方卡了。每个函数下都放个 print.
    dingling136
    dingling136
    Apr 18, 2018
    15
    1 楼说的对,很大可能没有设置 timeout。
    另外可以加杀死进程的代码。在下一次启动任务时,先执行一下杀死进程。注意 2 个 crontab
    lookwi
    lookwi
    Apr 18, 2018 via iPhone
    16
    爬虫:我有自己的想法了,我要看小电影,歇一会
    okzpy9425
    okzpy9425
    Apr 18, 2018
    17
    只说自己爬虫程序卡死了,也不说自己具体使用的是什么技术。。也不贴代码,这让人怎么给你分析?

    大多数原因都是阻塞在了某个链接上,如果你使用 python 的协程 处理不好的话很容易卡死的。
    anywalker707
    anywalker707
    Apr 18, 2018
    18
    被一只早起的鸟,吃了
    xiangR
    xiangR
    Apr 18, 2018
    19
    可以看一下,是不是卡在打 log 上了。我曾经碰到过,将所有 log 配置都去除,只有在抛异常的时候再打 log
    qingshan16
    qingshan16
    Apr 18, 2018
    20
    当然是等它复活啊
    kongkongyzt
    kongkongyzt
    Apr 18, 2018 via Android
    21
    记得 close connection
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1025 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 18:33 · PVG 02:33 · LAX 10:33 · JFK 13:33
    ♥ Do have faith in what you're doing.