Use f-strings
This commit is contained in:
parent
9f1bd098bc
commit
1bd1ced732
|
@ -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
|
||||
afford the (often high) prices charged by many stock data APIs.
|
||||
|
||||
# Requirements
|
||||
* Python 3.5+
|
||||
* Python 3.6+
|
||||
* Beautiful Soup 4
|
||||
|
||||
# Installation
|
||||
|
|
|
@ -41,7 +41,7 @@ class Stock:
|
|||
def __init__(self, ticker):
|
||||
try:
|
||||
r = requests.get(
|
||||
"https://finance.yahoo.com/quote/{}/history".format(ticker),
|
||||
f"https://finance.yahoo.com/quote/{ticker}/history",
|
||||
headers={
|
||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user