title: Scraping historical data from Yahoo Finance with Python
body: <p>as some of you probably know by now, it seems that Yahoo! Finance has discontinued its API for stock market data. While I am aware of the existence of the <code>fix-yahoo-finance</code> solution, I was trying to implement a more stable solution to my code by directly scraping historical data from Yahoo.</p>
  
  <p>So here is what I have for the moment:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  page = requests.get("https://finance.yahoo.com/quote/AAPL/history?period1=345423600&amp;period2=1495922400&amp;interval=1d&amp;filter=history&amp;frequency=1d")
  soup = BeautifulSoup(page.content, 'html.parser')
  soup
  print(soup.prettify())
  </code></pre>
  
  <p>To get the data from Yahoo table I can do:</p>
  
  <pre><code>c=soup.find_all('tbody')
  print(c)
  </code></pre>
  
  <p>My question is, how do I turn "c" into a nicer dataframe? Thanks!</p>