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

driver.get(url)如何在 for 循环中保持呢?

  •  
  •   jahan · Dec 2, 2017 · 2739 views
    This topic created in 3219 days ago, the information mentioned may be changed or developed.
    代码块 1
    driver.get(url)
    wait
    for~~~~~:
    ~~~~~
    ele = find_elements_by_path
    ~~~~~~~~
    try:
    ~~####
    except e:
    #####


    代码块 2
    for ~~~~:
    driver.get(url)
    wait
    ele =find_elements_by_path
    ~~~~~~~~
    try:
    ~~####
    except e:
    #####


    代码块 1 在第一遍循环中是正常的,ele 能够返回列表;第二遍循环就会报错 out of index range,ele 返回空列表,
    代码块 2 属于正常的满足,功能,可是每次 driver.get(url)然后 wait,真的开销很大,有没有好的办法解决呢?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   940 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:09 · PVG 03:09 · LAX 12:09 · JFK 15:09
    ♥ Do have faith in what you're doing.