Home > database >  Get Community Tab Data on youtube(Python)
Get Community Tab Data on youtube(Python)

Time:08-22

I am trying to get data from the Community Tab of a youtube channel, however this does not seem to be supported by the youtube api which I have used so far. I have tried many things including parsing the html but with no luck.

The data I wish to get is:

  1. Number of community posts
  2. Oldest community post date
  3. Newest community post date

Thanks in advance to all who help

CodePudding user response:

To precise user17252227 answer, you better directly parsing the ytInitialData JavaScript variable returned in the HTML to avoid using a slow JavaScript interpreter such as Selenium. As you understand, you will need to use pagination in a similar way as the YouTube Data API v3. Your best luck is to reverse-engineer the community tab by using your Network developer tool tab of your web browser.

CodePudding user response:

I cant really find a way to see the oldest communiy post date or the number of community posts.With webscraping you can only get the firts 9 community posts. So if the Youtubes API doesnt support a feauture that can get you that its gona be hard to find the oldest and the number of posts. Your scrapper will need to manualy load(youtube only loads the firts 9 and then you have to scroll to load the next 9) all of the community posts of a channel count them and find the oldest one.

  • Related