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.
Another option to get highlighted/selected text:
import subprocess import shlex selected_text = subprocess.check_output((shlex.split('xclip -out -selection')))