Skip to content

Commit 60f6efe

Browse files
committed
Merge branch 'fix-build' of https://github.com/MaximSmolskiy/Python into fix-build
2 parents fd1f93e + 598431d commit 60f6efe

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)