• Memorial Day Sale! Claim the biggest discount of the year with $50 off VIP using code MEM50. Sign up here.

How to Scrape Data from Yahoo Finance?

Solution
Just to add to what's been written here previously (as there is nothing wrong with it) but if python is your choice, you can do some nifty tricks with the yfinance package and pandas:

Python:
import yfinance as yf
import pandas as pd

data = yf.Ticker('YM=F')
df = data.history(interval='5m', period='60d', prepost=True)

data.history returns a pandas dataframe. :)

YFinance doesn't always work, sometimes updating it will cause it to work again. Don't build systems that are auto trading based on their data, as it is good data but unreliable in delivery. The documentation for yfinance is good:
https://pypi.org/project/yfinance/

Happy Trading,
-mashume

smrcute

New member
Closing your Yahoo account does not cancel the automatic payments associated with your account. Once you complete your Yahoo Mail account, anyone who tries to send a message to your email address will immediately receive a delivery error message. To avoid the hassle, be sure to let your contacts know that you're going to close your Yahoo Mail account - both from the email address you plan to use in the future (so they can quickly reply to contact you) and from your Yahoo Mail address (to make sure the message is received). And after the email account is closed, senders trying to report the address of a remote Yahoo Mail account will receive a delivery error message.
 
Last edited:

mashume

Well-known member
VIP
Lifetime
Just to add to what's been written here previously (as there is nothing wrong with it) but if python is your choice, you can do some nifty tricks with the yfinance package and pandas:

Python:
import yfinance as yf
import pandas as pd

data = yf.Ticker('YM=F')
df = data.history(interval='5m', period='60d', prepost=True)

data.history returns a pandas dataframe. :)

YFinance doesn't always work, sometimes updating it will cause it to work again. Don't build systems that are auto trading based on their data, as it is good data but unreliable in delivery. The documentation for yfinance is good:
https://pypi.org/project/yfinance/

Happy Trading,
-mashume
 
Solution

GulliveR

New member
We go to the main page of Yahoo Finance and enter the Ticker of the desired paper into the search engine. Let's take anyone as an example. Then we go to the historical data section. In the window, we request the desired period of dates and set the frequency (daily data, weekly, monthly. Scroll down to the end of the page and load the data in text format. Open EXCEL and go to the "Data" tab, the "Getting external data" section. We find the downloaded file (*.csv format). In the first window of the data loading dialog, select the data format "delimited" and "my data contains headers." The following dialog box is dedicated to choosing the separator between the data. Yahoo Finance uses a comma for this. After that, click on "Done" and tell EXCEL where to upload the data. If it didn't work out, then you can make check stubs online, and then you won't have to download all the data at all.
 
Last edited:

Similar threads

Top