Selenium定位的元素被图层遮挡了的解决办法

针对遮挡问题

element=driver.find_element_by_xpath("//*[text()='后一页']")

driver.execute_script("arguments[0].click();", element)

相当好用,因为直接注入js脚本,就不是在屏幕上操作了,而是js操作,神级操作啊



作者:a维度
链接:https://www.jianshu.com/p/ef4d1693a24c
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

猜你喜欢

转载自www.cnblogs.com/ali-test/p/11348057.html
今日推荐