Copy highlighted text to clipboard, then use the clipboard to append it to a list

后端 未结 5 1008
刺人心
刺人心 2020-12-16 18:54

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.

5条回答
  •  独厮守ぢ
    2020-12-16 19:31

    Another option to get highlighted/selected text:

    import subprocess
    import shlex
    selected_text = subprocess.check_output((shlex.split('xclip -out -selection')))
    

提交回复
热议问题