title: Printing specific HTML values with Python
body: <p>I am having some trouble printing only a specific value of the scraped html</p>
  
  <p>This the specific line of HTML my program scrapes for</p>
  
  <pre><code>&lt;input name="form_key" type="hidden" value="MmghsMIlPm5bd2Dw"/&gt;
  </code></pre>
  
  <p>My code is as follows</p>
  
  <pre><code>import requests, time
  from bs4 import BeautifulSoup
  from colorama import Fore, Back, Style, init
  
  
  print(Fore.CYAN + "Lets begin!"")
  init(autoreset=True)
  
  url = raw_input("Enter URL: ")
  
  print(Fore.CYAN + "\nGetting form key")
  
  
  r = requests.get(url)
  
  soup = BeautifulSoup(r.content, "html.parser")
  
  data = soup.find_all("input", {'name': 'form_key', 'type':'hidden'})
  
  for data in data:
      print(Fore.YELLOW + "Found Form Key:")
      print(data)
  </code></pre>
  
  <p>The program scrapes it fine, but prints the entire line where I desire to only print "MmghsMIlPm5bd2Dw" (no quotes)</p>
  
  <p>How can I achieve this??</p>
  
  <p>I have tried things like</p>
  
  <pre><code>print soup.find(data).text
  </code></pre>
  
  <p>And</p>
  
  <pre><code>last_input_tag = soup.find("input", id="value")
  print(last_input_tag)
  </code></pre>
  
  <p>But nothing has seemed to really work</p>