I\'m trying to automate some actions in a browser or a word processor with pyautogui module for Python 3 (Windows 10).
There is a highlighted text in a browser.
You could import pyperclip and use pyperclip.copy('my text I want copied') and then use pyperclip.paste() to paste the text wherever you want it to go. You can find a reference here.
pyperclip
pyperclip.copy('my text I want copied')
pyperclip.paste()