본문 바로가기
공부/에러창고

hanspell JSONDecodeError 해결방법

by E0 2023. 10. 17.

출처: https://github.com/ssut/py-hanspell/issues/31

 

JSONDecodeError: Expecting value; line1 column 1(char0) 오류 · Issue #31 · ssut/py-hanspell

안녕하세요. 기존에 hanspell을 사용하여 프로젝트를 하고 있는 컴퓨터공학과 학생입니다. 다름이 아니라, 며칠 전까지만 해도 오류 없이 잘 실행되던 코드가 제목과 같이 오류가 생성되어 이렇게

github.com

 

0. hanspell 파일 위치 찾는 명령어
cmd(시작>찾기>실행에서 cmd 검색 혹은 탐색기 창에 바로 cmd 검색) -> pip show hanspell

 

1. contants.py 의 base_url 다음과 같이 변경
base_url = https://m.search.naver.com/p/csearch/ocontent/util/SpellerProxy

 

2. spell_checker.py payload 다음과 같이 변경

payload = {
        '_callback': 'jQuery11240003383472025177525_1680133565087',
        'q': text,
        'where': 'nexearch',
        'color_blindness': 0
    }

 

3.spell_checker.py 61번째줄 r 수정
r = r.text[42:-2] -> r=r.text[44:-2]로 수정