Exemple #1
0
def getQuote(yahooticker):
    url = makeQueryURL(yahooticker)
    content = retrieveURL(url)
    try:
        quote = parseYahooURL(content)
    except PARSEERROR:
        raise YFINANCE_ERROR(yahooticker)
    return quote
Exemple #2
0
def getQuote(ticker):
    url = makeQueryURL(ticker)
    content = retrieveURL(url)
    try:
        quote = parseURL(content)
    except PARSEERROR:
        raise ONVISTA_ERROR(ticker)

    return float(quote)
Exemple #3
0
def getQuote(ticker, countrycode=None):
    url = makeQueryURL(ticker, countrycode)
    content = retrieveURL(url)
    try:
        quote = parseURL(content)
    except PARSEERROR:
        raise MARKETWATCH_ERROR(ticker)

    return float(quote)
Exemple #4
0
def getQuote(currency):
    url = makeQueryURL(currency)
    content = retrieveURL(url)
    try:
        quote = parseURL(content)
    except PARSEERROR:
        raise CURRENCY_ERROR(currency)

    return float(quote)
Exemple #5
0
import yfinance as yf
import shttp as ht
import gfinance as gf

url = yf.makeQueryURL('GOOG')
r = ht.retrieveURL(url)
ss = [ht.retrieveURL(x) for x in ht.getStyleSheets(r)]

ss = [removeComments(x) for x in ss]

def findFontSizeStyles(content):
    import re


def removeComments(x):
    import re

    y = re.sub('/\*.*?\*/', '', x, re.DOTALL | re.MULTILINE | re.UNICODE)
    return y

def findFontSizes(x):
    import re

    y = re.findall('([^{]*?){[^}]*?font-size:\s*?(\d+)([^;}\n]+).*?}', x,  re.DOTALL | re.UNICODE | re.MULTILINE)
    return y


###########
style = """

abc {