Scrape YouTube Comments With Python: Step-by-Step Tutorial

preview_player
Показать описание
CHAPTERS
00:00 - Introduction
01:17 - Register for Youtube Data API v3
03:27 - Create Python Script
06:36 - Create Get Comment function
08:38 - Add Error handling to our function
09:31 - Calling our function in a loop and collecting results
12:19 - Response Object Explanation
13:08 - Writing comments to CSV!
15:22 - Testing
18:21 - Conclusion

"Welcome to our comprehensive Python tutorial on how to scrape YouTube comments and export them to a CSV file. This step-by-step guide is perfect for beginners and intermediate Python users who are interested in data scraping, data analysis, and automation.

In this tutorial, we'll cover:

Introduction to web scraping with Python
Using Python for YouTube data extraction
How to extract comments from YouTube videos
Converting YouTube comments into a CSV format for easy data analysis

I hope you enjoy!
Рекомендации по теме
Комментарии
Автор

Thanks for posting! This looks interesting and useful.

arthurwilton
Автор

Hey, thanks for this video. I'm looking forward to see the next video about sentiment analysis:)

jenugan
Автор

Dude thanks for this. I was trying to do this through frontend, what a pain haha.

rheavictor
Автор

Thanks very much for this tutorial! I augmented the code a bit to add a few more fields, along with a header...

csvWrite = csv.writer(file)
csvWrite.writerow(["publishedAt", "authorDisplayName", "likeCount", "textDisplay"])
for i in comments:
row = [
i["snippet"]["topLevelComment"]["snippet"]["publishedAt"],
i["snippet"]["topLevelComment"]["snippet"]["authorDisplayName"],
i["snippet"]["topLevelComment"]["snippet"]["likeCount"],

]
csvWrite.writerow(row)

TheUtuber
Автор

This video was really helpful. Thank you.

NischayJoshi-zvyq
Автор

A really excellent video

#fwmseab015

barrykrusch