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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file MorningScraper-0.1.tar.gz
.
File metadata
- Download URL: MorningScraper-0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d4fade4a3baed2729b08d9eec226d26df00a417787f87dfc456a0495eef7922 |
|
MD5 | 6b6ba854b51eee086ab00de65dddc446 |
|
BLAKE2b-256 | 79c84844b5057fb881397d787c523985bebe7c20248ef415674357754918b6ea |
Provenance
File details
Details for the file MorningScraper-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: MorningScraper-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32e3a2abde9b7ad5ad129aba4c6fdcc43e46e2c404f4e7079f6671620131dacc |
|
MD5 | 2d7dfdd34a473ae95f9b7a695ce8bef3 |
|
BLAKE2b-256 | 52c1b7267ae68eda66931b06c8bb218b0b4f153096a5002c1e8fc4199c0efd3a |