본문 바로가기

Project/개인적인 프로젝트

갤럭시 S21 광고에 대한 소비자 반응 분석 (유튜브, 네이버 지식인)

광고를 기획하는 것만큼 중요한 것이 광고 효과를 분석하는 것이라고 생각합니다.

최근 갤럭시 S21 광고가 소비자들에게 어떻게 다가왔는지,
유튜브 댓글네이버 지식인 글을 크롤링하여 워드 클라우드를 생성함으로써 분석해보겠습니다.

전체적인 순서는 다음과 같습니다.

1. 크롤링
  1-1. 유튜브 크롤링
  1-2. 네이버 지식인 크롤링

2. 형태소 분석, 명사 추출, 불용어 제거
  2-1. 유튜브
  2-2. 네이버 지식인

3. 워드 클라우드 생성
4. 결과 분석
5. 참고 자료


1. 크롤링

1-1. 유튜브 댓글 크롤링

크롤링과 관련한 포스팅은 이전에 다루었기 때문에 새롭게 추가되는 개념만 말씀드리면,
스크롤 다운 명령을 필요로 한다는 점입니다.

유튜브 댓글의 html 특성상 스크롤을 아래로 내려야 댓글들이 보이기 때문에
스크롤을 끝까지 내린 후, beautifulsoup 으로 끌어오면 됩니다.

 

# 라이브러리 로드 
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver as wd
import time

import nltk
from konlpy.tag import Twitter
from wordcloud import WordCloud, STOPWORDS
from PIL import Image
import urllib
from urllib.request import urlopen
import warnings; warnings.filterwarnings('ignore')
import matplotlib
matplotlib.rc('font', family='Malgun Gothic')
import matplotlib.pyplot as plt
from tqdm import tqdm_notebook

import konlpy.tag
from collections import Counter

# 갤럭시 S21 광고 크롤링 
str_youtube_comments = []
youtube_list = ['https://www.youtube.com/watch?v=bC9TksWbq-I','https://www.youtube.com/watch?v=OCGhNmhTSVc']

for i in range(len(youtube_list)):

    driver = wd.Chrome(executable_path="C:/Users/김상휘/PycharmProjects/Hwi/Spider/hotel/chromedriver.exe")

    url = youtube_list[i]
    driver.get(url)

    last_page_height = driver.execute_script("return document.documentElement.scrollHeight")

    while True:
        driver.execute_script("window.scrollTo(0, document.documentElement.scrollHeight);")
        time.sleep(3)
        new_page_height = driver.execute_script("return document.documentElement.scrollHeight")

        if new_page_height == last_page_height:
            break
            
        last_page_height = new_page_height

    html_source = driver.page_source
    driver.close()
    
    soup = BeautifulSoup(html_source, "lxml")
    youtube_comments = soup.select("yt-formatted-string#content-text")
    
    for i in range(len(youtube_comments)):
        str_tmp = str(youtube_comments[i].text)
        str_tmp = str_tmp.replace('\n', '')
        str_tmp = str_tmp.replace('\t', '')
        str_tmp = str_tmp.replace('   ','')
        str_youtube_comments.append(str_tmp)
        
# 수집된 결과 확인 
print('수집된 댓글 수 : ',len(str_youtube_comments)) 
str_youtube_comments

 

 

같은 방법으로 '갤럭시 S21 to go 서비스' 광고 영상에 대한 댓글을 수집하면 아래와 같습니다.

 

 

1-2. 네이버 지식인 글 크롤링

네이버 지식인 글 크롤링의 경우에는 url 의 수정만으로도 원하는 정보를 모두 가져올 수 있기 때문에
간단하게 beautifulsoup 만을 이용해서 크롤링 할 수 있습니다.

 

# '갤럭시 S21 광고' 를 검색어로 검색한 네이버 지식인 글 크롤링 
tmp1 = 'https://search.naver.com/search.naver?where=kin&kin_display=10&qt=&title=0&&answer=0'
html = tmp1 + '&grade=0&choice=0&sec=0&nso=so%3Ar%2Ca%3Aall%2Cp%3Aall&query={input}&c_id=&c_name=&sm=tab_pge&kin_start={n}'
openurl = urlopen(html.format(input=urllib.parse.quote('갤럭시 S21 광고'), n=1))
soup = BeautifulSoup(openurl, 'html.parser')
tmp = soup.find_all('li','bx _svp_item')

tmp_list = []
for line in tmp:
    tmp_list.append(line.text)

# 크롤링 결과 확인 
print(tmp_list)

 

 

2. 형태소 분석, 명사 추출, 불용어 제거

2-1. 유튜브

먼저 여러 문장이 합쳐진 하나의 string 을 각 형태소로 분리해줍니다.
이후 워드 클라우드에 사용할 명사만을 추출한 후 결과를 보겠습니다.

 

t = Twitter()
present = ''
for each_line in real[:(pg-1)*10]:
    present = present + each_line + ' '

# 형태소 분석
Okt = konlpy.tag.Okt()
Okt_morphs = Okt.pos(present)
   
# 명사 추출
Noun_words = []
for word, pos in Okt_morphs:
    if pos == 'Noun':
        Noun_words.append(word)

c = Counter(Noun_words)
print(c.most_common(50))

 

 

명사만 잘 분리된 것을 확인할 수 있습니다.

이제 '거', '좀', '왜' 등의 불용어와 분석 결과에 불필요한 '광고', '삼성' 등의 명사들을 제거해줍니다.

 

useless_words = ['광고','진짜','거','삼성','애플','좀','폰','왜','보고','이','이번','때','이제','분','더','그','뭐','휘','오','아시','저', '제발','제일','지금','나','항상','여기','가즈','정말','그냥','것','내','누구','노','난','은','건'] 
tokens = [each_word for each_word in Noun_words if each_word not in useless_words] 
to = nltk.Text(tokens) 
to.vocab().most_common(50)

 

 

2-2. 네이버 지식인

유튜브 댓글에서의 처리와 다른 점은 페이지당 10개의 글이 하나의 리스트 원소로 들어간다는 것이고,
따라서 반복문의 조건만 다르게 처리해줍니다.

 

t = Twitter() 
present = '' 
for each_line in real[:(pg-1)*10]: 
	present = present + each_line + ' ' 
    
# 형태소 분석 
Okt = konlpy.tag.Okt() 
Okt_morphs = Okt.pos(present) 

# 명사 추출 
Noun_words = [] 
for word, pos in Okt_morphs: 
	if pos == 'Noun': 
    	Noun_words.append(word) 
        
# 불용어 제거 
useless_words = ['갤럭시','광고','저장','바로가기','이전','관련','제','더','그냥','질문','답변','문서','다음','좀','이','분','금제'] 
tokens = [each_word for each_word in Noun_words if each_word not in useless_words] 
to = nltk.Text(tokens) 
to.vocab().most_common(25)

 

 

3. 워드 클라우드 생성

위 내용을 바탕으로 각각 워드 클라우드를 생성해줍니다.

 

wordcloud = WordCloud(font_path = 'C:/Windows/Fonts/malgun.ttf', relative_scaling=0.5, background_color='white').generate_from_frequencies(dict(to.vocab().most_common(30))) 

plt.figure(figsize=(15,4)) 
plt.imshow(wordcloud) 
plt.axis('off')

 

갤럭시 S21 유튜브 광고 댓글 워드 클라우드 (좌) / 갤럭시 S21 to go 서비스 광고 댓글 워드 클라우드 (우)

 

네이버 지식인 '갤럭시 S21 광고' 검색 결과 워드 클라우드 

 

4. 결과 분석

갤럭시 S21 유튜브 공식 광고 영상 댓글과 네이버 지식인의 관련 질문들을 워드 클라우드해 본 결과,
공통적으로 '노래''모델' 의 언급이 많음을 확인할 수 있습니다.

이는 과거 갤럭시 광고에서 주로 볼 수 있었던 핸드폰의 기능적인 요소와 거리가 있어보이는데,
요즘 소비자들은 어떤 기능이 추가되었는지 보다는, 광고 속 핸드폰 디자인이 얼마나 세련되었고, 얼마나 인상깊었는지에 더 관심을 가지는 것으로 보입니다.

 

유튜브 갤럭시 노트 20 광고 캡쳐 화면


특히 소비자들은 감성적인 특성 중에서도 '모델''노래' 에 관심이 많은 것으로 보여지는데,
유명인과 비유명인 중 어떤 광고 모델이 더 효과적인지, 어떤 광고 노래가 소비자들의 이목을 더 집중시킬 수 있는지는 추가적인 분석을 통해 검증해봐야 할 것 같습니다.

조금 의아했던 점은 네이버 지식인 워드 클라우드에서는 핸드폰의 기능과 성능에 관련된 단어가 많을 것이라 예상했지만, 그렇지 않았다는 것입니다.

확실히 핸드폰 기술은 상향평준화 되었기 때문에 기술적인 측면에서 소비자들의 이목을 집중시키기는 어렵고,
핸드폰 디자인, 광고 모델 및 구성 등 감성적인 측면에서 소비자들에게 접근해야할 때로 보입니다.

5. 참고 자료

- 유튜브 댓글 크롤링 관련 자료 : https://m.blog.naver.com/blueday9404/221867706722

- 형태소 및 불용어 관련 자료 : https://mkjjo.github.io/python/2019/07/09/korean_preprocessing.html

- 네이버 지식인 크롤링 관련 자료 : https://m.blog.naver.com/PostView.naver?blogId=owl6615&logNo=221797466174&proxyReferer=https:%2F%2Fwww.google.com%2F