Skip to main content

Simple scraper for morningstar.co.uk

Project description

A quick and dirty web page scraper for morningstar.co.uk.

Some stocks are updated via javascript and so the information is not available by just scraping the html.

funds are best referenced by ISIN e.g.

'GB00B54RK123' - CF Odey Opus I Acc

'LU1023728089' - Moorea Fd Euro Fixed Income IE

stocks are best referenced by name and exchange e.g.

'LLOY LSE' - Lloyds Banking Group PLC

'GOOG NASDAQ' - Google Inc Class C Capital Stock

functions

morningscraper.search(ref, verbose=False)

Search morningstar.co.uk for ref

If ref is found and is a fund or stock return details

Args:

ref (str): search term can be ISIN or search term

verbose (bool): provide output

Returns:

list of dicts: containing info

dict for stock:
    {
        'name': (str) name of stock
        'url': (str) url for stock info
        'type': (str) 'Stock'
        'ticker': (str) ticker name
        'currency': (str) currency code of stock
    }

dict for fund:
    {
        'name': (str) name of fund
        'url': (str) url for fund info
        'type': (str) 'Fund'
        'ISIN': (str) ISIN of fund
    }

morningscraper.get_data(ref, verbose=False)

Search morningstar.co.uk for ref

If ref is found return details for each fund/stock

Args:

ref (str): search term can be ISIN or search term

verbose (bool): provide output

Returns:

list of dicts: containing info:

[{
    'name': (str) name of the fund/stock
    'ISIN': (str) ISIN reference for the fund/stock
    'date': (Date) date of valuation
    'value': (Decimal) value of the fund/stock
    'currency': (str) currency e.g. GBP USD
    'change': (str) percent change, including %
    'type': (str) e.g. Fund Stock
    'url': (str) fully qualified url info gathered from
}, ...]

morningscraper.get_url(url, verbose=False)

open morningstar.co.uk url and return details

Args:

url (str): url to parse

verbose (bool): provide output

Returns:

dict: containing info:

{
    'name': (str) name of the fund/stock
    'ISIN': (str) ISIN reference for the fund/stock
    'date': (Date) date of valuation
    'value': (Decimal) value of the fund/stock
    'currency': (str) currency e.g. GBP USD
    'change': (str) percent change, including %
    'type': (str) e.g. Fund Stock
    'url': (str) fully qualified url info gathered from
}

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MorningScraper-0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

MorningScraper-0.1-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file MorningScraper-0.1.tar.gz.

File metadata

File hashes

Hashes for MorningScraper-0.1.tar.gz
Algorithm Hash digest
SHA256 4d4fade4a3baed2729b08d9eec226d26df00a417787f87dfc456a0495eef7922
MD5 6b6ba854b51eee086ab00de65dddc446
BLAKE2b-256 79c84844b5057fb881397d787c523985bebe7c20248ef415674357754918b6ea

See more details on using hashes here.

Provenance

File details

Details for the file MorningScraper-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for MorningScraper-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 32e3a2abde9b7ad5ad129aba4c6fdcc43e46e2c404f4e7079f6671620131dacc
MD5 2d7dfdd34a473ae95f9b7a695ce8bef3
BLAKE2b-256 52c1b7267ae68eda66931b06c8bb218b0b4f153096a5002c1e8fc4199c0efd3a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page