Io uso più recente di Chrome e chromedriver.
Ho un sito web con elementi del DOM e io digitare il testo in un inputfield
Codice HTML (scusate per l'immagine)
Codice Python:
#Espandere Ombra
def expand_shadow_element(elemento):
shadow_root = driver.execute_script ("return arguments[0].shadowRoot.bambini', elemento)
ritorno shadow_root
...
root1 = driver.find_element_by_id("UI-tf_Vorgangsname")
shadow_root1 = expand_shadow_element(root1)
root2 = shadow_root11.find_element_by_xpath("//input[@part='valore']")
tempo.sleep(2)
root2.fare clic su()
tempo.sleep(2)
root2.send_keys('testssdfs')
Diventare questo messaggio:
selenio.comune.le eccezioni.ElementNotInteractableException: Messaggio: Elemento non è raggiungibile da tastiera
Vedo, fare clic su sta lavorando, cursore è aktiv nel Campo di Input, ma send_keys non funziona.
Avete qualche idea?
Molte Grazie!