码迷,mamicode.com
首页 > 其他好文 > 详细

cannot focus element解决方案

时间:2018-05-21 16:04:52      阅读:1180      评论:0      收藏:0      [点我收藏+]

标签:comm   解决方案   focus   chain   .com   rom   key   imp   bdr   

If you enconter error "cannot focus element" when using Selenium+Python in Chrome to input value, you can use below code instead:

 

from selenium.webdriver.common.action_chains import ActionChains

element1 = driver.find_element_by_id("inputCtrl0")

ActionChains(driver).click(element1).send_keys("111").perform()

 

cannot focus element解决方案

标签:comm   解决方案   focus   chain   .com   rom   key   imp   bdr   

原文地址:https://www.cnblogs.com/AmyHu/p/9067066.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!