1

I'm using selenium to click a button in browser which acts to copy text to clipboard. Once copied, I need to be able to manipulate the text, preferably by storing the text as an object or by 'pasting' into a .txt file or similar.

How can I go about achieving this?

anon
  • 149
  • 1
  • 3
  • 9

1 Answers1

1

There are shell commands for accessing the Mac Pasteboard: pbcopy and pbpaste. You can use them in python with os.system or subprocess.

Here's another answer for using shell commands in python.

benwiggy
  • 1,237
  • 13
  • 33