Skip to content

Commit b579604

Browse files
committed
Fix
1 parent 4ac753a commit b579604

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_programming/current_stock_price.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ 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("fin-streamer", {"data-testid": "qsp-price"})
27+
specific_fin_streamer_tag = soup.find("span", {"data-testid": "qsp-price"})
2828

2929
if specific_fin_streamer_tag:
3030
text = specific_fin_streamer_tag.get_text()
3131
return text
32-
return "No <fin-streamer> tag with the specified data-test attribute found."
32+
return "No <fin-streamer> tag with the specified data-testid attribute found."
3333

3434

3535
# Search for the symbol at https://finance.yahoo.com/lookup

0 commit comments

Comments
 (0)