From 8d13bfcc3c0303964e06d345c5f68aa714473577 Mon Sep 17 00:00:00 2001 From: Jack Kuo Date: Sun, 6 Oct 2024 01:22:45 +0800 Subject: [PATCH] Fix no data-test attribute found in current_stock_price.py --- web_programming/current_stock_price.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_programming/current_stock_price.py b/web_programming/current_stock_price.py index 9567c05b0558..5db4752e9ac7 100644 --- a/web_programming/current_stock_price.py +++ b/web_programming/current_stock_price.py @@ -8,7 +8,7 @@ def stock_price(symbol: str = "AAPL") -> str: 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"}) + specific_fin_streamer_tag = soup.find("fin-streamer", {"data-testid": "qsp-price"}) if specific_fin_streamer_tag: text = specific_fin_streamer_tag.get_text()