Why is the send_keys function ignoring spaces in my python script? I used vnc on ubuntu/debian 10. Everything works correctly when I run the script on my computer, but all spaces disappear on vps with vnc. Error is in Google chrome. `
element.send_keys("1 2 3")
result: "123"
`
Replacing the spaces with "Keys.SPACE" did not help me.
I tried adding two slashes element.send_keys("John\\ Doe")
CodePudding user response:
Try importing the libs and instantiate actions:
# Needed libs
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
# We create the driver
driver = webdriver.Chrome()
action = ActionChains(driver)
Then make click into your element with something like:
element.click()
Then send the keys like:
action.send_keys(departure).perform()
CodePudding user response:
I haven't been able to get this to work in Chrome. But spaces work fine in Firefox, so I'll have to use that. If someone finds the cause or solution to my problem, please write