Skip to content

Instantly share code, notes, and snippets.

@theDreamer911
Created October 23, 2021 17:07
Show Gist options
  • Save theDreamer911/d885cc5029372e494ef5a07b4b9c4f83 to your computer and use it in GitHub Desktop.
Save theDreamer911/d885cc5029372e494ef5a07b4b9c4f83 to your computer and use it in GitHub Desktop.
this extended version of youtube comment scrapper python modules
from youtube_comment_scraper_python import *
import pandas as pd
link = input("Youtube links: ")
saved = input("Output name: ")
youtube.open(link)
response = youtube.video_comments()
data = response['body']
df = pd.DataFrame(data)
df.to_csv(saved)
@Alejandro-github-mx
Copy link

Alejandro-github-mx commented Jun 3, 2022

One question, newbie here. When I run the code it mention an error on line 9:

data = response['body']

It says:

TypeError: 'NoneType' object is not subscriptable

What can I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment