I'm trying to select an option from datalist using selenium. First, send the option name from keys, and after send an arrow down to select it. Everything goes well until send ENTER key, it does not take any action. I must press down and enter keys to make the submit button clickable and can't modify the HTML code
I have tried
- Send the whole name to the input
- Send DOWN and ENTER keys together
- Send RETURN Key
This is the datalist HTML code
...
<input _ngcontent-njw-c0="" list="salesmans" placeholder="Selecciona Cliente o Vendedor" style="width: 100%;border: none;">
<datalist _ngcontent-njw-c0="" id="salesmans">
<option _ngcontent-njw-c0="" value="Vendedor Venta" ng-reflect-value="Vendedor Venta"></option>
<option _ngcontent-njw-c0="" value="juan peña hjvgvghghc" ng-reflect-value="juan peña hjvgvghghc"></option>
...
My python code
...
user_selector = WebDriverWait(self.loader.chrome_driver, con.TIME_LIMIT).until(
ec.presence_of_element_located((By.XPATH, '//input[@placeholder="Selecciona Cliente o Vendedor"]')))
user_selector.send_keys(user_auth_data[2])
user_selector.send_keys(Keys.ARROW_DOWN)
...
Element image: