Browse Source

Use f-strings

pull/4/head
Samuel Sloniker 2 years ago
parent
commit
1bd1ced732
  1. 4
      README.md
  2. 2
      stockquotes/__init__.py

4
README.md

@ -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

2
stockquotes/__init__.py

@ -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"
}, },

Loading…
Cancel
Save