I was finally able to work out the code for my scraping. It seemed to be working fine and then all of a sudden when I ran it again, I got the following error message:
You don't define the vector, url, before trying to subset it. url is also a function in the base package, so url[i] is attempting to subset that function... which doesn't make sense.
You probably defined url in your prior R session, but forgot to copy that code to your script.