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

Python 下,用 try......except 检测页面元素,但是等待时间很长

  •  
  •   pythonbryan · 2017-12-20 10:39:05 +08:00 · 1778 次点击
    这是一个创建于 2290 天前的主题,其中的信息可能已经有所发展或是发生改变。

    检测页面的元素是否存在,不存在的话就直接跳过,进入正常的语句。报错其实应该很快,但是不知道为什么会过很久才跳到下一个语句。不知道问题出在哪里,大家遇到过吗?

    6 条回复    2017-12-28 22:22:47 +08:00
    lavenKin
        1
    lavenKin  
       2017-12-20 13:57:19 +08:00
    开局一标题,内容全靠猜
    kuaidanian
        2
    kuaidanian  
       2017-12-20 16:45:11 +08:00
    要等待页面元素加载完,应该有个超时时间吧
    cominghome
        3
    cominghome  
       2017-12-20 17:27:26 +08:00
    @lavenKin 还真是,这描述谁知道发生了什么
    julyclyde
        4
    julyclyde  
       2017-12-20 18:26:03 +08:00
    估计是分不清服务器端和客户端,误以为页面是交互式运行的
    TesterCC
        5
    TesterCC  
       2017-12-21 17:39:16 +08:00
    @lavenKin 他应该是在做自动化测试。
    Kylin30
        6
    Kylin30  
       2017-12-28 22:22:47 +08:00
    我的土办法,加 print,看脚本正在搞什么。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   946 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:03 · PVG 05:03 · LAX 14:03 · JFK 17:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.