rvest icon indicating copy to clipboard operation
rvest copied to clipboard

rvest and YouTube

Open PythonCoderUnicorn opened this issue 3 years ago • 0 comments

Hello rvest !

I searched for the term "youtube" in issues and no results.

My issue:

I was trying to use rvest to retrieve data from YouTube comment section, I used the Chrome InspectorGadget to find the correct <tags> and kept getting empty characters. I even tried with the {ralger} package. The only thing I was able to get was some empty <div> tags.

Upon further searching on scraping YouTube comment sections (all Python content showed up), it appears the only way to get such data is to use their Developer API.

My query:

Is it possible to have a rvest function that handles the YouTube developer API key that can parse the text?

The YouTube data that gets returned is JSON, and the scrolling to fetch more comments requires a loop as 50 objects are returned in a single API call.

I was curious if anyone else has tried to scrape YouTube for data using R. I know that Python has a library that as far as i have seen works only on Windows (i tried on Google Collab with failure).

Anyway, thanks for the great package. : )

PythonCoderUnicorn avatar Sep 16 '22 23:09 PythonCoderUnicorn