Giter Site home page Giter Site logo

yahooscraper's Introduction

YahooScraper

This program will take data from any website that you pass into the get_data function. Currently V2.0, I am just getting data from yahoo finance.

I). Understanding the parameters of scraper.get_data: 1). The stock name, or t, has to be passed to this funciton

2). base_url and web_attrs must be passed if you are doing anything
    outside of getting the historical data.
        
3). If you want to get data from financial pages on your url then
    set the pages kw to your dictionary.
        
4). If you want to get the historical data you must pass in the 
    data_source=..., and start=... kw.
    
5). If you want to get the current price then you must pass in the 
    frequency=int, and interval=int kw. Then this program will make 
    x calls to get the price every y seconds (x = interval, y = frequency)

II). Understanding the global variables in main.py:

The web_attributes and base_url dont't change in this program
Yahoo finance uses '?p=' in every url request 
Therefore each page only differs in the stock name and the financial key.
e.x
    This will get the summary for AAPL
        https://finance.yahoo.com/quote/AAPL?p=AAPL

    This will get the balance sheet for AAPL
        https://finance.yahoo.com/quote/AAPL/balance-sheet?p=AAPL

III). Understanding the financial_data dictionary: This dictionary will map a stocks name to another dictionary That dictionary maps the name of a dataframe then that DF e.x financial_data = {'AAPL' : {'Income' : pd.DataFrame, 'Balance' : pd.DataFrame, 'Cash' : pd.DataFrame, 'Historic' : pd.DataFrame, 'Key Stats': pd.DataFrame, 'Summary' : pd.DataFrame, 'Price' : pd.DataFrame}}

IV). Understanding the pages dictionary: pages is a dictionary that maps the user level name to the actual name of The page containing that data. When you pass this into get_data it will Iterate through each page and get the data for that based on the base_url And web attributes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.