빅데이터/자동화
[자동화] Python을 이용하여 유투브 댓글 크롤링(남의 소스 사용)
pbj0812
2020. 6. 2. 00:01
0. 목표
- egbertbouman님의 소스를 사용하여 유투브 댓글 크롤링
1. 설치
1) 링크 접속
2) 소스 다운로드
- clone or download -> download zip 클릭
- git 사용자라면 git clone https://github.com/egbertbouman/youtube-comment-downloader.git 으로 다운로드
3) 필요 라이브러리 설치
pip install requests
pip install lxml
pip install cssselect
2. 실행
1) 다운받은 폴더로 이동
2) youtube_id 획득
- www.youtube.com/watch?v=40WklavZYEs 라면 40WklavZYEs 가 youtube_id
3) 실행
- 40WklavZYEs 게시글의 댓글을 result.csv 라는 이름으로 저장
python downloader.py --youtubeid 40WklavZYEs --output result.csv
3. 결과
4. 참고
- github.com/egbertbouman/youtube-comment-downloader
egbertbouman/youtube-comment-downloader
Simple script for downloading Youtube comments without using the Youtube API - egbertbouman/youtube-comment-downloader
github.com