V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
shiyuu
V2EX  ›  Python

webdriver 自动化循环问题,当翻页检测到某个元素就重新执行

  •  
  •   shiyuu · Dec 24, 2021 · 1806 views
    This topic created in 1590 days ago, the information mentioned may be changed or developed.

    函数封装一个动作 url 固定,点击的标签从 1 顺序开始能进入到内容后开始翻页 现在当翻页到无法翻页时会出现元素 driver.find_element(By.XPATH,'//div[@class="over"]') 想要当出现这个元素的时候,重新执行访问 url ,接着点击标签 2 ,这样当找到结束元素时返回开头再循环顺序点 3 、4 、5 那我每点击一次翻页都查询一次 driver.find_element(By.XPATH,'//div[@class="over"]')是否存在 如果存在就重新执行这个函数

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:24 · PVG 07:24 · LAX 16:24 · JFK 19:24
    ♥ Do have faith in what you're doing.