Selenium操作模态弹窗(无需该网页在桌面最前)

Question

  selenium直接click模态弹窗时该网页必须在桌面最前

Solve:

  采用js直接操作dom并设置定时器等待元素加载。

  eg:

    execute_script('setTimeout(function(){document.getElementsByClassName("ant-select-item-option-state")[0].click()}, 1000)')

  

 

posted @ 2021-03-30 17:01  桃不狸心  阅读(357)  评论(0)    收藏  举报