mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Enable ruff S113 rule (#11375)
* Enable ruff S113 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,7 +4,9 @@ from bs4 import BeautifulSoup
|
||||
|
||||
def stock_price(symbol: str = "AAPL") -> str:
|
||||
url = f"https://finance.yahoo.com/quote/{symbol}?p={symbol}"
|
||||
yahoo_finance_source = requests.get(url, headers={"USER-AGENT": "Mozilla/5.0"}).text
|
||||
yahoo_finance_source = requests.get(
|
||||
url, headers={"USER-AGENT": "Mozilla/5.0"}, timeout=10
|
||||
).text
|
||||
soup = BeautifulSoup(yahoo_finance_source, "html.parser")
|
||||
specific_fin_streamer_tag = soup.find("fin-streamer", {"data-test": "qsp-price"})
|
||||
|
||||
|
Reference in New Issue
Block a user