Use f-strings

This commit is contained in:
Samuel Sloniker 2021-12-04 18:46:49 -08:00
parent 9f1bd098bc
commit 1bd1ced732
2 changed files with 3 additions and 3 deletions

View File

@ -1,9 +1,9 @@
`stockquotes` is a simple Python module for collecting stock/ETF and mutual fund (see #2) quotes and `stockquotes` is a simple Python module for collecting stock/ETF and mutual fund quotes and
historical data from Yahoo! Finance. It's perfect for developers who can't historical data from Yahoo! Finance. It's perfect for developers who can't
afford the (often high) prices charged by many stock data APIs. afford the (often high) prices charged by many stock data APIs.
# Requirements # Requirements
* Python 3.5+ * Python 3.6+
* Beautiful Soup 4 * Beautiful Soup 4
# Installation # Installation

View File

@ -41,7 +41,7 @@ class Stock:
def __init__(self, ticker): def __init__(self, ticker):
try: try:
r = requests.get( r = requests.get(
"https://finance.yahoo.com/quote/{}/history".format(ticker), f"https://finance.yahoo.com/quote/{ticker}/history",
headers={ headers={
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0" "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
}, },