How to get a Selenium/Ruby bot to wait before performing an action?

前端 未结 7 805
Happy的楠姐
Happy的楠姐 2020-12-16 21:28

I\'m building a Selenium/Ruby web bot that clicks on elements. The problem is, sometimes there isn\'t enough time for the page to load before the bot decides it can\'t find

7条回答
  •  伪装坚强ぢ
    2020-12-16 22:29

    A potential answer is in your stacktrace.

    driver.element(:class, "gb_P").when_present.click
    

提交回复
热议问题