I have a problem in coping with error in for loop.
In the code below, I want to scrape data tables and integrate as one dataframe.
During web scraping, some address links does not work, and web scraping stops and ends in the middle of the scraping process. (error location : doc = read_html(i, encoding = 'UTF-8')
How can I proceed next scraping process and complete iteration to the whole vector, ignoring errorneous link?
fdata = data.frame()
n = 1
for (i in data$address) {
doc = read_html(i, encoding = 'UTF-8')
dtable = doc %>%
html_table()
fdata = bind_rows(fdata, dtable)
len = length(data$address)
print(n/len*100)
n = n + 1
}