Understand the Find() function in Beautiful Soup
soup.find(“div”, {“class”:”real number”})[‘data-value’] Here you are searching for a div element, but the span has the “real number” class in your example HTML data, try instead: Here we are also checking for presence of data-value attribute. To find elements having “real number” or “fake number” classes, you can make a CSS selector: To get the 69% value: Or, a CSS selector: Or, locating the h6 element … Read more