Eu folosesc mai nou Chrome și chromedriver.
Am un site cu elemente DOM și am să tastați orice text într-o inputfield
Cod HTML (scuze pentru screenshot)
Cod Python:
#Extindă Umbra
def expand_shadow_element(element):
shadow_root = șofer.execute_script (întoarcerea argumente[0].shadowRoot.copii', element)
reveni shadow_root
...
root1 = șofer.find_element_by_id("UI-tf_Vorgangsname")
shadow_root1 = expand_shadow_element(root1)
root2 = shadow_root11.find_element_by_xpath("//intrare[@parte= "valoare"]")
timp.somn(2)
root2.faceți clic pe()
timp.somn(2)
root2.send_keys('testssdfs')
Am devenit această mesaje:
seleniu.comune.excepții.ElementNotInteractableException: Mesaj: Element nu este accesibil cu tastatura
Văd, faceți clic pe este de lucru, cursorul este aktiv în Câmpul de Intrare, dar send_keys nu funcționează.
Ai vreo idee?
Multe Mulțumiri!