Chromedriver only supports characters in the BMP error while sending Emoji with ChromeDriver Chrome using Selenium Python to Tkinter's label() textbox

后端 未结 3 1588
忘掉有多难
忘掉有多难 2020-11-30 13:01

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

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 13:20

    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 = "

提交回复
热议问题