It works for me:
from selenium import webdriver
JS_ADD_TEXT_TO_INPUT = """
var elm = arguments[0], txt = arguments[1];
elm.value += txt;
elm.dispatchEvent(new Event('change'));
"""
browser = webdriver.Chrome('C:\\Python37\\chromedriver.exe')
browser.get("https://google.com/")
elem = browser.find_element_by_name('q')
text = "🌎 🌊 " + u'\u2764'
browser.execute_script(JS_ADD_TEXT_TO_INPUT, elem, text)
More Related Contents:
- Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed
- WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH while setting UserAgent through Selenium Chromedriver python
- How to make Selenium not wait till full page load, which has a slow script?
- unknown error: session deleted because of page crash from unknown error: cannot determine loading status from tab crashed with ChromeDriver Selenium
- ‘Webdrivers’ executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
- USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection error with ChromeDriver v87 / Chrome v87 using Selenium on Windows10
- How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
- Running Selenium with Headless Chrome Webdriver
- WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127
- InvalidArgumentException: Message: invalid argument: user data directory is already in use error using –user-data-dir to start Chrome using Selenium
- Error Message: ‘chromedriver’ executable needs to be PATH
- Unable to use Selenium to automate Chase site login
- What is the fastest way to open urls in new tabs via Selenium – Python?
- Clicking on Get Data button for Monthly Settlement Statistics on nseindia.com doesn’t fetch results using Selenium and Python
- How to set window size in Selenium Chrome Python
- Download file through Google Chrome in headless mode
- WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited on Raspberry-Pi with ChromeDriver and Selenium
- How to download XML files avoiding the popup This type of file may harm your computer through ChromeDriver and Chrome using Selenium in Python
- How to disable CSS in Python selenium using ChromeOptions
- How to load extension within chrome driver in selenium with python
- How do I pass options to the Selenium Chrome driver using Python?
- DeprecationWarning: use options instead of chrome_options error using ChromeDriver and Chrome through Selenium on Windows 10 system
- SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python
- Chrome crashes after several hours while multiprocessing using Selenium through Python
- How to accept the popup presented when installing extension in Selenium?
- Chrome browser initiated through ChromeDriver gets detected
- WebDriverException: Service U:/Scraping/chromedriver.exe unexpectedly exited. Status code was: 1 while working with Chrome and Python
- Selenium – Python – AttributeError: ‘WebDriver’ object has no attribute ‘find_element_by_name’
- selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable using Selenium
- How to install Chrome Extension using Selenium & Python