title: Copy highlighted text to clipboard, then use the clipboard to append it to a list
body: <p>I'm trying to automate some actions in a browser or a  word processor with pyautogui module for Python 3 (Windows 10).</p>
  <p>There is a highlighted text in a browser.</p>
  <blockquote>
  <p><code>text</code></p>
  </blockquote>
  <p>the following script should print the highlighted text</p>
  <pre><code>import pyautogui as pya
  
  # double clicks on a position of the cursor
  pya.doubleClick(pya.position())
  
  list = []
  # a function copy_clipboard() should be called here
  var = copy_clipboard()
  list.append(var) 
  print(list)
  </code></pre>
  <p>The output should be:</p>
  <p><code>[text]</code></p>
  <p>So how should the function <code>copy_clipboard()</code> look like?
  Thank you for your help.</p>