title: How to store copied text into a variable in Python using Selenium WebDriver
body: <p>I am working on some web scraping projects, where I scrape the data and store it into the CSV file. I am stuck in a case where I need to store copied the data into a variable.</p>
  
  <p>Actually, the text is generated after clicking on a button and automatically copied, just I need to save this copied text into a variable. Now for this, I use following commands but nothing is working.</p>
  
  <p>Command1-</p>
  
  <pre><code>   spam=driver.find_element_by_xpath('//div[@data-control-name="copy_address]').click()
     print("copied text",spam)
  </code></pre>
  
  <p>it shows "copied text none"</p>
  
  <p>Even I used pyperclip library as well but nothing works for me.</p>
  
  <p>Command2-</p>
  
  <pre><code>   pyperclip.copy(driver.find_element_by_xpath('//div[@data-control-name="copy_address"]').click())
     spam = pyperclip.paste()
  </code></pre>
  
  <p>How can I proceed?</p>