I have a column of ~8000 URLs from which I would like to scrape information. Not all the URLs work, so when I go to scrape the information using a for loop, R returns an error message saying "closing unused connection # (https://...)" and stops the scraping loop.
I was thinking of using a tryCatch to test whether the URLs work or not, but I'm not certain of how to use the syntax with rvest and creating a new column of true/false values. I want it to test each URL, and if it works, leave a 1 in a new column, and if it fails, leave a 0 in the new column, but continue to the next line regardless. How do I go about writing this code in R?
Thank you.