I'm trying to use Python / Selenium / Webdriver to automatically populate an input field on my Chrome page. However, I am not able to use the "send_keys" command to fill in the tilde character (~).
Here's my code:
import os
import sys
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
browser = webdriver.Chrome(executable_path=r"chromedriver.exe")
browser.get("https://mywebpageaddress")
browser.find_element_by_id("username").send_keys('charles~18')
The page is populated as "charles18" instead of "charles ~ 18".
Note: You can manually type "charles ~ 18" in this field via the browser.
Does anyone know how to solve it? Thanks!