0

I'm tring to select a textbox to input some data into it, the problem is i don't know how to get it's element:

This is what i get whem i do inspect on it:

<input class=" input" maxlength="255" type="text" aria-describedby="" placeholder="" id="8624:0" data-aura-rendered-by="8628:0" data-interactive-lib-uid="28">

The thing is that this is basically to fill forms, and id, rendered by, and uid numbers change. Is there anything i could try?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Smece
  • 1

1 Answers1

0

To send a character sequence to the <input> element you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies:

  • Using CSS_SELECTOR:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input.input[type='text'][data-aura-rendered-by][aria-describedby]"))).send_keys("Smece")
    
  • Using XPATH:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//input[@class=' input' and @type='text'][@data-aura-rendered-by and @aria-describedby]"))).send_keys("Smece")
    
  • Note: You have to add the following imports :

    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support import expected_conditions as EC
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352