Comments (11)
저 해결했습니다! 2가지 수정하였습니다.
spell_checker.py
payload
에서 passportKey와 _callback를 추가해야했습니다.
payload = { 'passportKey': 'curl값 copy로 알 수 있습니다.', '_callback': 'curl값 copy로 알 수 있습니다.', 'q': text, 'color_blindness': '0' }
그리고 61번째 줄 수정
`data = json.loads(r.text)` ->
`json_data = re.search(r'\((.*)\)', r.text).group(1)
# Parse the JSON data into a Python dictionary
data = json.loads(json_data)`
from py-hanspell.
저도 동일한 문제가 발생하는데 어떻게 해결하면 될까요?
from py-hanspell.
62 번째 줄
` data = json.loads(r.text)
# data = json.loads(r)
print("data", data)`
OUTPUT
data {'message': {'error': '유효한 키가 아닙니다.'}}
api 키에러 같습니다.
from py-hanspell.
저는 spell_checker.check() 동작 확인을 위하여 한글 문자열을 그대로 넣었는데 키에러가 발생했습니다. api 키에러면 어떻게 조치해야 동작할까요?
from py-hanspell.
payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a', '_callback': 'jQuery1124024353107794965956_1697593724680', 'q': text, 'color_blindness': '0' }
윗 분 덕분에 이렇게 수정해서 해결했습니다!
from py-hanspell.
두 분 덕에 해결법을 알게 된 듯 합니다. 감사합니다. 그런데 제가 초보라 curl값은 무엇인지, 어떻게 얻는지 공부하고 시도해보았지만 잘 안 되었습니다. 그래서 혹시 abikisyo님께서 올려주신 curl값 카피를 제가 그대로 사용해도 되는건가요? 아니면 curl값은 개인마다 고유로 생성해서 넣어야 하는 값인가요?
from py-hanspell.
저도 아는게 없는 초보자라 설명까지는 못드릴 것 같구! 키값은 크롬 개발자도구를 이용해서 찾았습니다!
from py-hanspell.
payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a', '_callback': 'jQuery1124024353107794965956_1697593724680', 'q': text, 'color_blindness': '0' } 윗 분 덕분에 이렇게 수정해서 해결했습니다!
혹시 payload 부분만 수정하니 해결하셨는지요? data 형식도 변경하셨을까요?
from py-hanspell.
모든 분들 감사드립니다. 해결하였습니다! 저는 payload 부분과,
import re json_data = re.search(r'\((.*)\)', r.text).group(1) # Parse the JSON data into a Python dictionary data = json.loads(json_data)
부분을 모두 수정하였습니다!
from py-hanspell.
두 부분을 수정해도 여전히 result를 찾지 못하는 에러({'message': {'error': '유효한 키가 아닙니다.'}})가 발생하는데 혹시 해결하신 분들 어떤 부분을 수정하셨는지 참고해 볼 수 있을까요?
- payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a'
, '_callback': 'jQuery1124024353107794965956_1697593724680'
, 'q': text, 'color_blindness': '0' }
2.61 data = json.loads(r.text)
->
json_data = re.search(r'((.*))', r.text).group(1)
data = json.loads(json_data)`
추적해 보니 base_url은 맞는건지 의문이 듭니다.
base_url = 'https://m.search.naver.com/p/csearch/ocontent/util/SpellerProxy'
from py-hanspell.
passportKey랑 _callback 부분이 주기적으로 바뀌는 걸로 알고있어요 오늘은 f889d5ee7ab9379c02331da9f04cc4b36001c960랑 jQuery112403327001357005035_1697768508744로 바뀌어있네요~
from py-hanspell.
Related Issues (20)
- 맞춤법 검사 모듈 횟수 제안
- spell_checker.check()을 하기 전에 필요한 전처리가 무엇인가요?
- JSONDecodeError: Expecting value: line 1 column 1 (char 0) 에러 발생
- spell_checker 적용하신분중 정상작동하시나요 HOT 4
- JSONDecodeError: Expecting value; line1 column 1(char0) 오류 HOT 17
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- purple_text
- hanspell 단점
- 오늘 새로운 passportKey 라는 파라미터가 추가되면서 동작하지 않는것 같습니다. HOT 6
- KeyError: 'result' HOT 6
- 스펠체커 오류 픽스 예상 일정 관련 HOT 1
- sepell_checker 관련하여 HOT 1
- KeyError: 'result' HOT 1
- KeyError
- KeyError: Result 에러에 대한 간단한 해결책 공유드립니다. HOT 1
- KeyError: Result 에러 해결 방법을 좀 더 간편하게 수정해 보았습니다. HOT 1
- result error 해결 방법 2가지 모두 사용했는데 계속 오류가 생깁니다. HOT 2
- [이슈 문의] KeyError: 'result' HOT 2
- 패키지 설치 오류 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-hanspell.