diff --git a/yfinance/base.py b/yfinance/base.py index 8c7731e1e..fbaddd650 100644 --- a/yfinance/base.py +++ b/yfinance/base.py @@ -42,8 +42,7 @@ from .scrapers.holders import Holders from .scrapers.quote import Quote, FastInfo -_BASE_URL_ = 'https://query2.finance.yahoo.com' -_ROOT_URL_ = 'https://finance.yahoo.com' +from .const import _BASE_URL_, _ROOT_URL_ class TickerBase: diff --git a/yfinance/const.py b/yfinance/const.py index 15e2d6f17..383ee9931 100644 --- a/yfinance/const.py +++ b/yfinance/const.py @@ -1,3 +1,5 @@ +_BASE_URL_ = 'https://query2.finance.yahoo.com' +_ROOT_URL_ = 'https://finance.yahoo.com' fundamentals_keys = { 'financials': ["TaxEffectOfUnusualItems", "TaxRateForCalcs", "NormalizedEBITDA", "NormalizedDilutedEPS", @@ -113,3 +115,5 @@ "PaymentstoSuppliersforGoodsandServices", "ClassesofCashReceiptsfromOperatingActivities", "OtherCashReceiptsfromOperatingActivities", "ReceiptsfromGovernmentGrants", "ReceiptsfromCustomers"]} + + diff --git a/yfinance/utils.py b/yfinance/utils.py index e6bee3bab..7bb8bc4f9 100644 --- a/yfinance/utils.py +++ b/yfinance/utils.py @@ -43,7 +43,7 @@ from dateutil.relativedelta import relativedelta from pytz import UnknownTimeZoneError -from .base import _BASE_URL_ +from .const import _BASE_URL_ try: import ujson as _json