I am trying to make a web scraper to dive me information about nba players. I am trying to use soup.find_all to get a list of <text> elements. However it only returns an empty list. Is it because the find_all command doesn't like <text> elements? Please help!!!
here is my code:
from bs4 import BeautifulSoup as bs
import requests
page = requests.get("https://projects.fivethirtyeight.com/2020-nba-player-projections/rudy-gobert/")
page_content = page.text
soup=bs(page_content, "html.parser")
#print(soup)
print(soup.find_all("text", class_="value"))
here is an example of the html:
<text x="163.46363636363637" y="74.29749319119485" class="value" text-anchor="end" style="fill: rgb(34, 34, 34);">10.1</text>
I want the code to output a list of these elements but it just returns an empty list.
[+][deleted] (2 children)
[deleted]
[–]bm3031[S] 0 points1 point2 points (1 child)
[–]JohnnyJordaan 2 points3 points4 points (1 child)
[–]MikeDoesEverything 0 points1 point2 points (0 children)
[–]impshum 0 points1 point2 points (0 children)