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

运行爬虫的时候 macOS 状态栏卡死

  •  
  •   masha ·
    mashaz · 2017-03-22 16:29:13 +08:00 · 2245 次点击
    这是一个创建于 2593 天前的主题,其中的信息可能已经有所发展或是发生改变。
    爬虫运行的时候 状态栏如下图卡死(系统自带的状态卡死,第三方不受印象)

    * 渣画质见谅,那个圆圈卡死的鼠标状态竟然不能被 QuickTime 截到,于是手机远远的拍的(破 6s 近处已无法对焦)
    下面是这个爬虫 import 的包



    ## 系统 10.12.2 , python2.7
    7 条回复    2017-04-10 23:21:31 +08:00
    xshwy
        1
    xshwy  
       2017-03-22 16:58:01 +08:00
    前排小板凳围观大神根据 import 判断卡死原因
    masha
        2
    masha  
    OP
       2017-03-22 17:03:03 +08:00 via iPhone
    @xshwy 不好意思我才是小白,你对这个原因有见解的话可以直接发表,我只能这样猜测了,因为这个爬虫和我其他爬虫唯一不同的地方就是 import 的不同了。而这个是我写到现在唯一一个因为长时间运行而卡死状态栏的
    masha
        3
    masha  
    OP
       2017-03-22 17:06:23 +08:00 via iPhone
    @masha 每次长时间运行都会卡
    xshwy
        4
    xshwy  
       2017-03-22 18:13:02 +08:00
    @masha 哎嗨嗨 不好意思 我也是菜鸟,我认为光从 import ,看不出卡的问题出在哪儿;最好是贴出你的代码,让大神分析一下哪里出了问题。
    xray887
        5
    xray887  
       2017-03-22 18:18:02 +08:00
    估计,你的 webdriver 开多了,并且没有关闭,导致系统资源紧张,导致卡死现象。建议检查一下 webdriver 有没有 close 掉。
    VicYu
        6
    VicYu  
       2017-03-22 20:42:18 +08:00
    @masha 电脑配置,内存太小? selenium 用的那个 browser ,起了多少个线程,一个任务结束调用 close 没有?等等
    masha
        7
    masha  
    OP
       2017-04-10 23:21:31 +08:00 via iPhone
    @xray887 @VicYu 不好意思都忘了这么个帖子了,谢谢回复,都排查过不是这些原因
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2674 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:13 · PVG 19:13 · LAX 04:13 · JFK 07:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.