I get the following error when trying to AttributeError: 'NoneType' object has no attribute 'text'
import requests from bs4 import BeautifulSoup import numpy as np headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", } html = requests.get("https://finance.yahoo.com/quote/BSPAX", headers=headers) soup = BeautifulSoup(html.text, "html.parser") A1=[float(soup.find("fin-streamer", class_="Fw(b) Fz(36px) Mb(-4px) D(ib)").text)]