bref_team_results() returns no data
The bref_team_results() function results in the error message: "Invalid arguments or no team results data available!"
Example code: bref_team_results("MIN", 2022)
Other functions that pull data from baseball reference fail as well.
I wonder if this is the same issue I'm hitting with standings_on_date_bref(), as I receive the same error. When I replicate the internals of the method, it looks like this error is caught and a variation on the error you received is returned:
> url %>% xml2::read_html()
Error in open.connection(x, "rb") : HTTP error 403.
Since 403 means forbidden, I tried with various user agents, (i.e. httr::set_config(httr::user_agent("[email protected]")) including some that showed as allow all under b-ref's robotx.txt, but now I'm just getting timeouts, suggesting I'm going in the wrong direction.
What's interesting (to me, anyway) is that my timing doesn't line up with yours - I was scraping b-ref on the date you opened this issue without problem, yet today is the first time I encountered this error.
No problem with bref_team_results("MIN", 2022) on my end, @darrenpage15. Have you tried updating to the latest version or reinstalling altogether?
On most recent dev release, we've added a 5 second rest for all calls to baseball-reference functions to comply with their scraping guidelines announced recently. While I believe all 403 and 429 issues should resolve themselves within 24 hours or so according to their new policy. As a result of complying, these 403/429 issues will stop happening, even if the time to resolve the query will take ~5x amount of time as it used to.