Hi everyone, I am trying to scrape individual game data from fbRef and I am hitting a wall as each individual home and away team on each page seem to have a different data reference. For example:
1st Game - Manchester United vs. Leeds United Match Report – Saturday August 14, 2021 | FBref.com
Home Team - #stats_19538871_summary tbody tr
Away Team - #stats_5bfb9659_summary tbody tr
2nd Game - Brentford vs. Arsenal Match Report – Friday August 13, 2021 | FBref.com
Home Team - #stats_cd051869_summary tbody tr
Away Team - #stats_18bb7c10_summary tbody tr
So because of this I cannot scrape the necessary data. Is there anyone that can help me with this? I have attached the sitemap below (I have created a different sitemap for home and away data just so it is easier to organise):
Sitemap:
{"_id":"fbrefawayindgamedata","startUrl":["https://fbref.com/en/comps/9/schedule/Premier-League-Scores-and-Fixtures"],"selectors":[{"delay":0,"id":"Categoryid","multiple":true,"parentSelectors":["_root"],"selector":".center a","type":"SelectorLink"},{"delay":0,"id":"CollectionData","multiple":true,"parentSelectors":["Categoryid"],"selector":"div.box","type":"SelectorElement"},{"delay":0,"id":"Player","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"th","type":"SelectorText"},{"delay":0,"id":"Home Team","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":"div:nth-of-type(1) [itemprop='performer'] a","type":"SelectorText"},{"delay":0,"id":"Away Team","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":".scorebox div:nth-of-type(2) a[itemprop='name']","type":"SelectorText"},{"delay":0,"id":"ShirtNo","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='shirtnumber']","type":"SelectorText"},{"delay":0,"id":"Nation","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td.left","type":"SelectorText"},{"delay":0,"id":"Date","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":".scorebox_meta strong a","type":"SelectorText"},{"delay":0,"id":"Time","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":"span.venuetime","type":"SelectorText"},{"delay":0,"id":"Matchweek","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":".box > div:nth-of-type(1)","type":"SelectorText"},{"delay":0,"id":"Home Goals","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":"div:nth-of-type(1) div.score","type":"SelectorText"},{"delay":0,"id":"Away Goals","multiple":false,"parentSelectors":["Categoryid"],"regex":"","selector":".scorebox div:nth-of-type(2) .scores div.score","type":"SelectorText"},{"delay":0,"id":"Pos","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='position']","type":"SelectorText"},{"delay":0,"id":"Age","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='age']","type":"SelectorText"},{"delay":0,"id":"Min","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='minutes']","type":"SelectorText"},{"delay":0,"id":"Goals","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='goals']","type":"SelectorText"},{"delay":0,"id":"Assists","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='assists']","type":"SelectorText"},{"delay":0,"id":"PK Goals","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='pens_made']","type":"SelectorText"},{"delay":0,"id":"PK attempt","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='pens_att']","type":"SelectorText"},{"delay":0,"id":"Shots","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='shots_total']","type":"SelectorText"},{"delay":0,"id":"ShotsOT","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='shots_on_target']","type":"SelectorText"},{"delay":0,"id":"YCs","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='cards_yellow']","type":"SelectorText"},{"delay":0,"id":"RCs","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='cards_red']","type":"SelectorText"},{"delay":0,"id":"Touches","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='touches']","type":"SelectorText"},{"delay":0,"id":"Press","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='pressures']","type":"SelectorText"},{"delay":0,"id":"Tackles","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='tackles']","type":"SelectorText"},{"delay":0,"id":"Int","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='interceptions']","type":"SelectorText"},{"delay":0,"id":"Blocks","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='blocks']","type":"SelectorText"},{"delay":0,"id":"xG ","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='xg']","type":"SelectorText"},{"delay":0,"id":"npxG","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='npxg']","type":"SelectorText"},{"delay":0,"id":"xA ","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='xa']","type":"SelectorText"},{"delay":0,"id":"Sht Creat Acts","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='sca']","type":"SelectorText"},{"delay":0,"id":"Goal Creat Acts","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='gca']","type":"SelectorText"},{"delay":0,"id":"Pass Cmp","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='passes_completed']","type":"SelectorText"},{"delay":0,"id":"Pass Att","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='passes']","type":"SelectorText"},{"delay":0,"id":"Pass Cmp%","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='passes_pct']","type":"SelectorText"},{"delay":0,"id":"Pass Prog","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='progressive_passes']","type":"SelectorText"},{"delay":0,"id":"Carries","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='carries']","type":"SelectorText"},{"delay":0,"id":"Carries Prog","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='progressive_carries']","type":"SelectorText"},{"delay":0,"id":"Dribb Succ","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='dribbles_completed']","type":"SelectorText"},{"delay":0,"id":"Dribb Att","multiple":false,"parentSelectors":["AwayStatsElement"],"regex":"","selector":"td[data-stat='dribbles']","type":"SelectorText"},{"delay":0,"id":"AwayStatsElement","multiple":true,"parentSelectors":["CollectionData"],"selector":"#stats_18bb7c10_summary tbody tr","type":"SelectorElement"}]}