Data scrapping an IMDB website

Hello I am trying data scrapping for the first time. I am using an IMDB website to scrape the data from. While scrapping a gross income field I am facing issues while replacing spaces to NA's. I used the following loop to put NA's to its respective entries:

for(i in c(12,47,54,64,67,75,85,95,97))
{
a = gross_data[1:(i-1)]
b = gross_data[i:length(gross_data)]
gross_data = append(a,list("NA"))
gross_data = append(gross_data,b)
}
But after running this loop I am getting NA's for every entry. Can you please help me with this? I am using the "rvest" package.

Also I was using this example from this site: https://www.analyticsvidhya.com/blog/2017/03/beginners-guide-on-web-scraping-in-r-using-rvest-with-hands-on-knowledge/

Thank you

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.