import data for (i in data) rewrite


Welcome to the RStudio community!

Using a print screen image is not the best way to post a question on here, because we would have to read and type everything by hand if we like to work with your code. Please read the guide on how to create a reprex to make sure folk can start helping your more quickly in future. A reprex consists of the minimal code and data needed to recreate the issue/question you're having. You can find instructions how to build and share one here:

The reason you overwrite now is because in your loop you are writing every time to a thus overwriting the previous values. You can use an apply statement to save everything into a list like so

# c is your vector of urls
myData = lapply(c, function(url){
 page = read_html(url)
 a = html_nodes(page, ".number")

Hope this helps,