def getQuote(yahooticker): url = makeQueryURL(yahooticker) content = retrieveURL(url) try: quote = parseYahooURL(content) except PARSEERROR: raise YFINANCE_ERROR(yahooticker) return quote
def getQuote(ticker): url = makeQueryURL(ticker) content = retrieveURL(url) try: quote = parseURL(content) except PARSEERROR: raise ONVISTA_ERROR(ticker) return float(quote)
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)
def getQuote(currency): url = makeQueryURL(currency) content = retrieveURL(url) try: quote = parseURL(content) except PARSEERROR: raise CURRENCY_ERROR(currency) return float(quote)
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 {