We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ac753a commit b579604Copy full SHA for b579604
web_programming/current_stock_price.py
@@ -24,12 +24,12 @@ def stock_price(symbol: str = "AAPL") -> str:
24
url, headers={"USER-AGENT": "Mozilla/5.0"}, timeout=10
25
).text
26
soup = BeautifulSoup(yahoo_finance_source, "html.parser")
27
- specific_fin_streamer_tag = soup.find("fin-streamer", {"data-testid": "qsp-price"})
+ specific_fin_streamer_tag = soup.find("span", {"data-testid": "qsp-price"})
28
29
if specific_fin_streamer_tag:
30
text = specific_fin_streamer_tag.get_text()
31
return text
32
- return "No <fin-streamer> tag with the specified data-test attribute found."
+ return "No <fin-streamer> tag with the specified data-testid attribute found."
33
34
35
# Search for the symbol at https://finance.yahoo.com/lookup
0 commit comments