JaseZiv / worldfootballR

A wrapper for extracting world football (soccer) data from FBref, Transfermark, Understat
https://jaseziv.github.io/worldfootballR/
466 stars 60 forks source link

get_match_shooting error when only one table available #43

Closed szfh closed 3 years ago

szfh commented 3 years ago

It's possible to only have one team shots in a match, which causes an error with get_match_shooting.

library(worldfootballR)
# library(tidyverse)

urltest <- "https://fbref.com/en/matches/bf52349b/Fulham-Arsenal-September-12-2020-Premier-League"
url1 <- "https://fbref.com/en/matches/f35f4268/Huddersfield-Town-Swansea-City-March-10-2018-Premier-League"
url2 <- "https://fbref.com/en/matches/5e35e444/Bournemouth-Manchester-City-March-2-2019-Premier-League"

# this one works
shotstest <- get_match_shooting(urltest)

# these ones don't
shots1 <- get_match_shooting(url1)
shots2 <- get_match_shooting(url2)
JaseZiv commented 3 years ago

This should now be resolved with commit 74db787.

Reach out if there's any further issues.

Thanks heaps