Data scrapping an IMDB website

I was trying data scrapping using “rvest” package. I was referring the following blog:

But while setting the missing values for gross_data as NaN I used the exact same loop given. But it is changing every record as NaN. Can anyone please help me with a more simple loop approach? Or tell me what am I doing wrong?
This is what I coded:
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)

I am new to R.

1 Like

You can scrape / extract data from IMDb website. Just go to the detailed page of any movie, open the Parsers extension and click on the data you want to extract. You can select several types of data on the page, for example: title movies, duration, release date, Image URL, description.

© Copyright 2013-2019 Analytics Vidhya