0
votes

I am looking at web scraping the stocks from apple between 2017-2018. I am aware that you can download the excel sheet and have the data that way but I want to download it via python. (https://finance.yahoo.com/quote/AAPL/history?period1=1483228800&period2=1514764800&interval=1d&filter=history&frequency=1d)

I have followed this website (https://www.scrapehero.com/scrape-yahoo-finance-stock-market-data/) and haven't got too far.

Thanks.

1

1 Answers

1
votes

Copy the below JSON; instead of scraping just use the JSON array to access it in your code. You don't need to scrape continuously as this is old data that is not going to change; therefor the best option is store it and access it anytime.

Sample JSON object:

 {
   "Date": "12/28/2017",
   "Open": 171,
   "High": 171.850006,
   "Low": 170.479996,
   "Close": 171.080002,
   "Adj Close": 168.549545,
   "Volume": 16480200
 }

I put the entire JSON up for you here: http://ilanpatao.com/misc/aapl.json