def send_keys(self,loc,value):
    '''
    send keys
    Usage:
    send_keys((By.XPATH,"//a"),'a')
    '''
    self.find(loc).click()
    context=self.find(loc).get_attribute('text')
    self.driver.keyevent(123)
    for i in range(0,len(context)):
        self.driver.keyevent(67)
    sleep(3)
    self.find(loc).send_keys(value)


↙↙↙阅读原文可查看相关链接,并与作者交流