I'm trying to do some data scraping from a bunch of related websites (they are different NFL team rosters from different years). My code works if I run it all separately, but when I try to use a for loop, it breaks in random places. Can anyone see the issue with this code?

Code:
forvalues i=1976/2019 {
    foreach var in ARI ATL BAC BAL BUF CAR CIN CLE DAL DEN DET GB HOO HOU IND JAC KC LAC LAA LAR MIA MIN NE NO NYG NYJ OAK PHI PHO SD SF SEA SLC STL TB TEN WAS {
        clear
        readhtmltable https://www.justsportsstats.com/footballroster.php?team=`var'&year=`i'
        gen year = `i'
        save "/Desktop/`i' `var' rosters (QB).dta", replace
    }
}
The error is an error with the user-generated -readhtmltable- command that says that it can't read the table for a given webpage...but then when I try to do that webpage not in the for-loop, it works.