title: How to scrape particular data from Yahoo Finance?
body: <p>I am new to web scraping and I'm trying to scrape the "statistics" page of yahoo finance for AAPL. Here's the link: <a href="https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL" rel="nofollow noreferrer">https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL</a></p>
  
  <p>Here is the code I have so far...</p>
  
  <pre><code>from bs4 import BeautifulSoup
  from requests import get
  
  
  url = 'https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL'
  response = get(url)
  soup = BeautifulSoup(response.text, 'html.parser')
  
  stock_data = soup.find_all("table")
  
  for stock in stock_data:
      print(stock.text)
  </code></pre>
  
  <p>When I run that, I return all of the table data on the page. However, I only want specific data from each table (e.g. "Market Cap", "Revenue", "Beta").</p>
  
  <p>I tried messing around with the code by doing <code>print(stock[1].text)</code> to see if I could limit the amount of data returned to just the second value in each table but that returned an error message. Am I on the right track by using BeautifulSoup or do I need to use a completely different library? What would I have to do in order to only return particular data and not all of the table data on the page?</p>