Skip to content

None type has no attribute text #4

@NADoebler

Description

@NADoebler

Hi there,

I am getting the following error:

` ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
c:\Users******\Work Folders\Documents\Fußball\Scrapping.ipynb Cell 8 in <cell line: 1>()
----> 1 BL_teams_1 = get_team_data('https://fbref.com/en/comps/20/','/Bundesliga-Stats', 'for')

c:\Users******\Work Folders\Documents\Fußball\Scrapping.ipynb Cell 8 in get_team_data(top, end, text)
158 def get_team_data(top,end,text):
--> 159 df1 = frame_for_category_team('stats',top,end,stats3,text)
160 df2 = frame_for_category_team('keepers',top,end,keepers3,text)
161 df3 = frame_for_category_team('keepersadv',top,end,keepersadv2,text)

c:\Users******\Work Folders\Documents\Fußball\Scrapping.ipynb Cell 8 in frame_for_category_team(category, top, end, features, text)
123 url = (top + category + end)
124 player_table, team_table = get_tables(url,text)
--> 125 df_team = get_frame_team(features, team_table)
126 return df_team

c:\Users****\Work Folders\Documents\Fußball\Scrapping.ipynb Cell 8 in get_frame_team(features, team_table)
94 for row in rows_squad:
95 if(row.find('th',{"scope":"row"}) != None):
---> 96 name = row.find('th',{"data-stat":"squad"}).text.strip().encode().decode("utf-8")
97 if 'squad' in pre_df_squad:
98 pre_df_squad['squad'].append(name)

AttributeError: 'NoneType' object has no attribute 'text' `

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions