Skip to content

steinsein/onlinesacredplace.info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 

Repository files navigation

한국의 '온라인 성지' 개념에 관한 연구

이 저장소는 온라인 성지 개념에 관한 연구에서 활용된 기술적인 정보들을 공유하기 위한 곳입니다.
발표 예정인 논문의 타이틀은 "한국의 ‘온라인 성지(聖地)’ 개념의 출현과 진화: ‘쿠키닷컴’ 게시물 댓글 텍스트 분석을 중심으로"입니다.
서지 정보는 논문 출판 이후에 업데이트할 예정입니다.

사용 데이터

디시인사이드 Hit갤의 '온라인 성지'로 여겨지는 게시물의 댓글과 Hit갤의 주요 인기 게시물

오늘 산 중저가형 모델 싸게 팝니다..(쿠키닷컴 게시물)
(엑스브이-3) 내 자취방에서 옹달샘 발견!!!!!!!!!!!(옹달샘)
이 사진이 실제인지 합성인지 판단 부탁드립니다.(사실? 합성?)
지하철 시체.. ㅡㅡa(지하철 시체)
아이구 구엽소 욘석.(개죽이)
경고문이오 쌔우다 이후 신선한 충격이 될 듯 하오(방법)
[ 우리는 무적의 솔로부대다 ] (Scroll & BGM)(솔로부대)
[공지]근성갤을 야갤의 식민지로 선포한다?(지귀글)
빠삐놈병神디스코믹스 (feat. 엄기뉴 전스틴 디제이쿠 이효리 한가인)(빠삐놈)
야 우리민족끼리 사이트 털면안되냐??(우리민족끼리)
안녕하세요ㅎㅎ 홍진홉니다(홍진호)
2015내방명록 아다뚫는사람(방명록 아다)
MEGAL WOMAN(스압,스포)(메갈여인)
스폰지밥 뉴 애피소드 1~30 (완)(스압)(스폰지밥)
30만원 생활비 일본인 와이프가 차려주는 저녁밥.JPG(30만원 생활비 일본 아내)

댓글 수집 방법

python의 selenium을 이용하여 댓글을 스크래핑함


기본 코드('쿠키닷컴' 게시물 댓글 수집 코드)
import requests
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
import pandas as pd
import openpyxl

URL = "https://gall.dcinside.com/board/view/?id=hit&no=12&page=1"
chromedriver = "./chromedriver.exe"

def driver_open(chromedriver):
    options = webdriver.ChromeOptions()
    options.add_argument("window-size=1920x1080")
    options.add_argument("headless")
    options.add_argument("lang=ko_KR")
    driver = webdriver.Chrome(chromedriver, options=options)
    return driver

def get_last_page(URL):
    driver = driver_open(chromedriver)
    driver.get(URL)
    last_page = driver.find_element(By.CLASS_NAME,"sp_pagingicon.page_end")
    n = int(last_page.get_attribute('href')[-8:-5])
    return n

def scrapping_comments(URL):
    n = get_last_page(URL)
    print(f"마지막 페이지:{n}")
    time.sleep(2)
    driver = driver_open(chromedriver)
    driver.get(URL)
    print("사이트 접근 성공")
    time.sleep(2)
    nicks = []
    usertxts = []
    dates = []
    for i in range(1, n+1):
        html = driver.page_source
        soup = BeautifulSoup(html,'html.parser')
        comment_box = soup.find("div","comment_box")
        comments = comment_box.find_all("li")
        for comment in comments:
            if comment.get("class") == ["ub-content"]:

                if comment.find(class_="del_reply") is None:
                    nick = comment.find("div","cmt_nickbox").text
                    nicks.append(nick)
                    usertxt = comment.select_one("div.clear.cmt_txtbox").text
                    usertxts.append(usertxt)
                    date = comment.find("span","date_time").text
                    dates.append(date)
                else:
                    pass
          
            elif comment.get('class') == ['ub-content','dory']:
                pass
            else:
                pass
        print(f"{i}번째 수집완료")
        driver.execute_script(f"viewComments({i+1},'D')")
        time.sleep(2)
    comment_dics = {
        "닉네임":nicks,
        "댓글":usertxts,
        "날짜":dates,
    }
    return comment_dics

def save_data(dics,name):
    df = pd.DataFrame(dics)
    df.to_csv(f"./{name}.csv")
    df.to_excel(f"./{name}.xlsx")
    return df
    

댓글 분석 방법

python의 konlpy의 OKT 형태소 분석기

"open-korean-text”, https://github.com/open-korean-text/open-korean-text

분석 내용

'쿠키닷컴' 게시물의 댓글에 연도별 빈도값 높은 단어들 추출, 연도별 댓글의 TF-IDF 가중치 부여
디시인사이드 Hit갤의 주요 게시물(조회수, 추천수, 댓글수 상위) 12건에 대한 '성지' 및 '-해주세요' 사용 빈도 및 시기 확인

파이썬 사용 환경(IDE)

google colab(graph, NLP), PyCham(scrapping)

발표 논문

성지 밈(聖地 meme) 소원 댓글의 유행과 온라인 종교문화상의 함의: ‘쿠키 닷컴’ 게시물 댓글 텍스트 분석을 중심으로