Skip to main content

Stock Scraper

Create an instance of the PyScrappy library to interact with the class StockScraper:

Helps in scrapping stock data

1. Analysis data of the stock2. Historical data of the stock3. Profile data of the stock
  • Type#


    class

  • Note#


    Create an object of this class to procced further.

    obj = PyScrappy.stock_scrapper()

Stock#

  • Methods#

    Here are certain in-built methods of the Stock Scrapper. Feel free to explore them.

    1. analysis_data_scrapper()#

    Helps in scrapping the Analytical data of the stock.

    return type#


    dictionary
    str
    pandas.DataFrame

    Parameters#


    stock_code: Enter the desired stock code.
    Type: str

    analysis_type: Enter the name of the analysis type of the stock.
    Type: str
    Accepted values: "earning estimate", "revenue estimate", "earning history", "EPS trend", "EPS revision", "growth estimate"

    Note#


    Make sure you enter a valid stock code.

    Example#


    obj = PyScrappy.stock_scrapper()obj.profile_data_scrapper('stock_code')

    2. profile_data_scrapper()#

    Helps in scraping the financial data of any particular comapany.

    return type#


    list

    Parameters#


    stock_code: Enter the desired stock code.
    Type: str

    Note#


    Make sure you enter a valid stock code. Make sure to store the result in three variable as list spreading.

    Example#


    obj = PyScrappy.stock_scrapper()obj.financial_data_scrapper('stock_code')

    3. historical_data_scrapper()#

    Helps in scraping the Historical data of the stock ('Date', 'Open', 'High', 'Low', 'Close', 'Adjusted Close', 'Volume')

    return type#


    Downloads a csv file.

    Parameters#


    stock_code: Enter the desired stock code.
    Type: str

    time_period: Enter the range/time period of the stock
    Type: str
    Accepted values: '1d', '5d', '3m', '6m', '1y', '5y', 'max' (or any value in 'd', 'm', 'y' format)

    frequency: Enter the time period interval of the data
    Type: str
    Accepted values: 'Daily', 'Weekly', 'Monthly'

    Note#


    Make sure you enter a valid stock code.

    Example#


    obj = PyScrappy.stock_scrapper()obj.historical_data_scrapper('stock_code')