Skip to content

Commit 598431d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b579604 commit 598431d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

web_programming/current_stock_price.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ def stock_price(symbol: str = "AAPL") -> str:
2424
url, headers={"USER-AGENT": "Mozilla/5.0"}, timeout=10
2525
).text
2626
soup = BeautifulSoup(yahoo_finance_source, "html.parser")
27-
specific_fin_streamer_tag = soup.find("span", {"data-testid": "qsp-price"})
2827

29-
if specific_fin_streamer_tag:
28+
if specific_fin_streamer_tag := soup.find("span", {"data-testid": "qsp-price"}):
3029
text = specific_fin_streamer_tag.get_text()
3130
return text
3231
return "No <fin-streamer> tag with the specified data-testid attribute found."

0 commit comments

Comments
 (0)