Issue
I am automating whatsapp messages and would like to send them out through a tkinter window. In this tkinter window I have created a message box with the help of .label() and I am able to connect to whatsapp web through selenium.
Currently, I am able to send out messages already, but without emojis. When I include emojis, I get this error "Chromedriver only supports characters in the BMP". How can I include emojis?
Solution
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)
Answered By - Jackssn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.