Open akaihola opened 1 year ago
This can be reproduced by copying content manually using Ctrl-C
and then calling message_field.send_keys(Keys.CONTROL, "v")
.
Focusing the automated browser window by clicking on the title bar somehow refreshes the clipboard, and pasting works correctly again.
Extended Unicode characters (e.g. emojis) can't be typed using Selenium
send_keys()
.The work-around is to copy the desired content into the clipboard and send a
Ctrl-V
instead.Clipboard management on the Python side can be done e.g. with pyclip or pyperclip. The backend can be e.g.
xsel
,xclip
orwl-clipboard
.With all of these tools, the symptom is the same: The first copied string is pasted perfectly. But every subsequent paste writes the initial copied string, no matter what else has been copied into the clipboard.
pyclip.paste()
andpyperclip.paste()
see the freshly copied string. TypingCtrl-V
manually into the automated browser always pastes the right thing.After restarting Keke, the clipboard works correctly again, but only once.