Error
AttributeError Traceback (most recent call last)
Cell In[23], line 2
1 first_team = soup.find('div', class_="rankings-block__banner--nation")
----> 2 first_team.text
AttributeError: 'NoneType' object has no attribute 'text'
my code is
first_team = soup.find('span', class_="rankings-block__banner--nation")
first_team.text
but in inspect inside span element no text is present
first_team = soup.find('div', class_="rankings-block__banner--nationality")
my=first_team.text
cleaned_text = my.split()[0]
cleaned_text
output
'PAK'
Top comments (0)