[실전] 크롤링과 데이터베이스 - 크롤링 코드 작성 시작 강의 6분 58초 내용입니다 에서 실행을 할 때 오류없이 카테고리 ALL 내용은 카테고리만 출력을 하고, 그다음 카테고리들 부터는 카테고리와 서브카테고리를 잘 출력을 합니다. 다른 카테고리들(ex패션의류 신발/잡화 등)은 서브카테고리들(브랜드 여성의류 등)이 있어서 sub_categories = soup.select('div.navi.group ul li > a') 통해서 서브카테고리들을 가져올 수 있는데 ALL (메인)카테고리에서는 서브카테고리에 해당하는 내용이 없어서 크롤링을 할 때 빈값을 가져오고 그러면, 출력을 할 때(sub_category.get_text()을 사용할 때) 빈 값이니까 오류가 나야 하는거 아닌가요?
안녕하세요? 헬로 마인크래프트 실행 과정 중에 자꾸 에러가 발생하여 문의 드립니다. 아래와 같은 에러 내용이 뜨는데, 인터넷 검색해보면 서버와 클라이언트의 idle.exe가 달라야 한다는 식의 내용이 뜨는데 무슨 말인지 모르겠습니다. 파이썬에 대해서 전혀 모르고 수업을 듣기 시작했는데, 나오는 문제들을 해결하려면 기본적으로 코딩을 알아야 하는 건가 싶습니다. ;;; 어떻게 해결할 수 있을지 설명 부탁 드립니다. ---------------------<에러내용>---------- Traceback (most recent call last): File "C:\Users\박아름\Desktop\마크와코딩\drive-download-20210721T045252Z-001\01 헬로 마인크래프트.py", line 2, in <module> mc = Minecraft.create() File "C:\Users\박아름\AppData\Local\Programs\Python\Python38-32\lib\site-packages\mcpi\minecraft.py", line 171, in create return Minecraft(Connection(address, port)) File "C:\Users\박아름\AppData\Local\Programs\Python\Python38-32\lib\site-packages\mcpi\connection.py", line 17, in __init__ self.socket.connect((address, port)) ConnectionRefusedError: [WinError 10061] 대상 컴퓨터에서 연결을 거부했으므로 연결하지 못했습니다
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. 안녕하세요. 파이썬 공부중인 학생입니다. vscode로 파이썬을 공부하면서 jupyter notebook을 설치하여 사용중이었습니다. ipynb 파일을 생성하면 셀이 생성되고 그 안에 소스코드를 작성할 수 있었는데요. 갑자기 ipynb에 있던 셀이 모두 사라지고 작성해놓았던 ipynb 파일 내용도 저렇게 변경되었습니다. 무언가 문제가 생긴 것 같아 구글링으로 jupyter notebook을 cmd - pip install jupyter로 다시 재설치해보려해도 이미 설치되어있는 것으로 나오는데 왜 갑자기 이런 문제가 발생한지 알수가 없습니다..... 다시 ipynb파일을 jupyter노트북으로 실행시키도록 하고싶습니다. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
안녕하세요. 이전 강의인 NMS에서도 궁금했는데, confidence 임계값이 어떻게 결정되는지 궁금합니다. IOU 같은 경우는 식으로 설명해주셔서 이해가 가는데, confidence 임계값인 경우에는 그런 것이 없더라구요. 좋은 강의 항상 잘 듣고있습니다. 감사합니다.
print 나 import 타이핑 할때 영상처럼 autocomplete 인지는 잘 모르겠는데 밑에 관련 되는 언어들이 뜨는데 전 안떠서 그러는데 무슨 문제인가요? 예를들어 import 치셧을때 밑에 ImportError 이런것들은 영상에 선생님은 뜨시는데 전안뜹니다. java언어로 치면 컨트롤+스페이스바 치면 뜨는데 파이썬도 그런 기능이있나요?
설계독학맛비's 실전 Verilog HDL Season 1 (Clock부터 Internal Memory까지)
안녕하세요. 리눅스 처음 다루는 학생입니다! 동영상(Verilog HDL 0장)대로 해서 설치까지는 완료했는데 그 이후에 실행할 때 오류가 나고 소싱도 안됐습니다. 그래서 동영상에서 하는 것들 여러가지를 해보다가 library link 과정에서 뭘 잘못했는지 libtinfo.so.5 가 빨간색으로 표시되네요ㅠ 어떻게 문제를 해결할까요? 혹시 다시깔 수 있다면 다시깔 수 있는 방법이라도 알려주세요.감사합니다!!
안녕하세요 좋은 강의 만들어주셔서 감사합니다 django 강의를 마친 후 이를 바탕으로 로그인, 회원가입, 프로필 확인, 삭제 정도 가능한 프로젝트를 새로 만들었습니다. 이를 바탕으로 강의의 profile 모델을 기반으로 한 간단한 api를 만들었고 지금 목적은 이 api를 기준으로 새로만든 django 프로젝트의 MODEL부분을 모두 api에서 관리하도록 적용하고싶은 학생입니다. 제가 만든 api의 명세서 입니다. https://documenter.getpostman.com/view/15940594/Tzm6kvP2 #accountapp/create.html {% extends 'base.html' %} {% load bootstrap4 %} {% block content %} <div style =" text-align : center ; max-width : 500 px ; margin : 4 rem auto ; " > <div class ="mb-4" > <h4> Signup </h4> </div> <form action ="{% url 'accountapp:create' %}" method ="post" > {% csrf_token %} {% bootstrap_form form %} <input type ="submit" class = "btn btn-dark rounded-pill col-6 mt-3" > </form> </div> {% endblock %} 에서 <form action ="{% url 'accountapp:create' %}" method ="post" > 이 부분의 url을 바꾸면서 class AccountCreateView(CreateView): model = User form_class = UserCreationForm success_url = reverse_lazy( 'profileapp:create' ) # reverse_lazy 는 클래스형 뷰에서 reverse 는 함수형 뷰에서 template_name = 'accountapp/create.html' 이 부분을 함수형 뷰로 바꿔서 진행하려는데 위에 만든 api의 json 형식을 어떤식으로 읽고 쓰게 할 수 있는지에 대한 방법론이 궁금합니다... 참고로 rest api 서버의 스토리지는 mariadb이고 추후에는 현 django 프로젝트의 모델을 전부 삭제하고 api로만 진행할 생각입니다. 소셜 로그인과 비슷한 형태로 진행하려고 했는데 참 힘들더라구요.. 공부가 부족한 것 같습니다 ------------------------------------------ 현재 방법을 찾던 중 https://www.daleseo.com/python-json/ 위 포스트를 보고 파이썬 내장 모듈인 json 모듈을 통해 입력받는 것을 공부중에 있습니다 혹시 다른 방법이 있는지 이 방법을 사용할 경우 문제점이 무엇인지 알려주시면 감사하겠습니다 ---------------------------------------------------------------------------- #accountapp/views.py import json , requests # Create your views here. def web_request (method_name , url , dict_data , is_urlencoded= True ): """Web GET or POST request 를 호출 후 그 결과를 dict 형으로 반환 """ method_name = method_name.upper() # 메소드이름을 대문자로 바꾼다 if method_name not in ( 'GET' , 'POST' ): raise Exception ( 'method_name is GET or POST plz...' ) if method_name == 'GET' : # GET 방식인 경우 response = requests.get( url =url , params =dict_data) elif method_name == 'POST' : # POST 방식인 경우 if is_urlencoded is True : response = requests.post( url =url , data =dict_data , headers ={ 'Content-Type' : 'application/x-www-form-urlencoded' }) else : response = requests.post( url =url , data =json.dumps(dict_data) , headers ={ 'Content-Type' : 'application/json' }) dict_meta = { 'status_code' : response.status_code , 'ok' : response.ok , 'encoding' : response.encoding , 'Content-Type' : response.headers[ 'Content-Type' ]} if 'json' in str (response.headers[ 'Content-Type' ]): # JSON 형태인 경우 return {**dict_meta , **response.json()} else : # 문자열 형태인 경우 return {**dict_meta , **{ 'text' : response.text}} python에서 http메소드의 post와 get을 사용할 수 있는 함수를 views.py 에 추가해주고 def signup (request): if request.method == 'POST' : print ( ' 리퀘스트 로그 ' + str (request.body)) username = request.POST.get( 'userid' , '' ) password = request.POST.get( 'userpw' , '' ) pw2 = request.POST.get( 'userpw2' , '' ) print (username , password , pw2) if password == pw2: json_signup = {} json_signup[ "username" ] = username json_signup[ "password" ] = password url = 'http://APIhost:port/register/' # 접속할 사이트주소 또는 IP 주소를 입력한다 data = json_signup # 요청할 데이터 # (example) data = {"username":"test123","password":"testword123"} print (data) response = web_request( method_name = 'POST' , url =url , dict_data =data) return HttpResponse( 'success' ) return render(request , "accounts/signup.html" ) 탬플릿의 http에서 따온 변수 userid, userpw를 따와서 파이썬 내장 모듈인 json을 통해서 json파일을 만들고 data 변수에 입력하고 위에서 만든 함수를 통해 api에 json 으로 POST 요청을 보내는 함수를 디자인하여 해결했습니다. 위 처럼 json을 통해 로그인과 패스워드를 api 서버와 주고받는다면 보안적으로 이슈가 될 만한 사항이 있을까요? -----------------------------------
// 맨 아래에 한 줄 요약 질문 있습니다...! 1rem이 16px 단위인 것이 불편하여, 어떻게 하면 직관적으로 px 단위와 1:1 매칭을 할 수 있을까 알아보던 도중, 아래와 같은 방법을 발견했습니다. html { font-size: 62.5%; /* 100% = 16px | 62.5% = 10px */ } body { font-size: 1.6rem; } 이렇게 하면 1rem이 10px을 의미하게 되어, 보다 직관적인 사이즈 조절이 가능하더라구요. 그런데, 위의 CSS 코드를 적용한 뒤, 강의 내용에 나온 rem의 수치들에 전부 1.6을 곱하여 재적용했음에도 불구하고, 사이즈가 뭔가 이상하게 엄청 작게 나오더군요... 알아보니 header들 (h1~h6)마다 font-size를 다시 재정의 내려야 하는 상황이 펼쳐지고... h1~h6 전부 공식 사이즈에 맞춰 rem값을 지정해봐도 강의에서 제공하는 결과물과 전혀 일치하지 않고... 너무 힘들어서 결국 전부 다 git reset --hard 하고 강의 내용대로 따라하고 있습니다. ============= 질문: 1rem을 10px로 만드는 위와 같은 (유명한) 트릭을 사용하는 방법은, 웬만하면 지양하는 게 나을까요?
python / pyautogui / pillow 모두 최신 버젼으로 되어 있습니다. vscode 상에서 b = pyautogui . locateCenterOnScreen ( ' five.png ' , confidence = 0.7 ) print ( b ) 다음처럼 five.png 이미지 파일 가운데 좌표를 출력하고 싶은데 런하면 터미널에 다음과 같은 에러가 뜹니다 ㅠㅠ PyScreezeException('The Pillow package is required to use this function.') 이미 pillow 라이브러리가 설치가 되어 있음에도 이런 에러가 왜 발생할까요? 이걸 해결하기 위해서 1) pillow > pyautogui 순으로 재설치 2) cmd 관리자 실행으로 해서 강제 재설치 3) 과거 PIL 라이브러리 있으면 삭제 모두 해보았지만 그대로 에러가 뜨는 상황입니다. python이 3.9.6 버젼인데 호환이 안 맞는게 문제인걸까요? 도와주세요 ㅠㅠ
- 학메뉵 없는 경우 습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중Debug with python 메뉴가 없어요ㅠㅠ하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. trello-server를 다운 받고 npm 설치 시 아래와 같은 오류가 발생합니다. node-gyp, windows build toos 등 cmd 관리자 모드로 실행하여 설치를 하고 다시 실행하였습니다. 하지만 계속 아래와 같은 오류가 발생합니다. 해결 방법을 알려주시면 감사하겠습니다. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated terraformer@1.0.12: terraformer is deprecated and no longer supported. Please use @terraformer/arcgis. npm WARN deprecated terraformer-wkt-parser@1.2.1: terraformer-wkt-parser is deprecated and no longer supported. Please use @terraformer/wkt. npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future npm WARN deprecated sequelize@4.44.4: This version will no longer receive security fixes per our security policy. Please update to sequelize@5 or above. npm ERR! code 1 npm ERR! path C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3 npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3\lib\binding\napi-v3-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0 npm ERR! node-pre-gyp info using node@16.4.1 | win32 | x64 npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node" (not found) npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-win32-x64.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.0.2 and node@16.4.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error self signed certificate in certificate chain npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.4.1 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.4.1 | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.6 found at "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe" npm ERR! gyp http GET https://nodejs.org/download/release/v16.4.1/node-v16.4.1-headers.tar.gz npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: self signed certificate in certificate chain npm ERR! gyp ERR! stack at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34) npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:394:28) npm ERR! gyp ERR! stack at TLSSocket._finishInit (node:_tls_wrap:944:8) npm ERR! gyp ERR! stack at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12) npm ERR! gyp ERR! System Windows_NT 10.0.19042 npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Administrator\\Documents\\trello-backend\\lecture-vue-trello-server-master\\node_modules\\sqlite3\\lib\\binding\\napi-v3-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\Administrator\\Documents\\trello-backend\\lecture-vue-trello-server-master\\node_modules\\sqlite3\\lib\\binding\\napi-v3-win32-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3" npm ERR! gyp ERR! cwd C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3 npm ERR! gyp ERR! node -v v16.4.1 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3\lib\binding\napi-v3-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\node-pre-gyp\lib\util\compile.js:83:29) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:394:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1067:16) npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042 npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\Documents\\trello-backend\\lecture-vue-trello-server-master\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" npm ERR! node-pre-gyp ERR! cwd C:\Users\Administrator\Documents\trello-backend\lecture-vue-trello-server-master\node_modules\sqlite3 npm ERR! node-pre-gyp ERR! node -v v16.4.1 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0 npm ERR! node-pre-gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-07-02T02_08_55_146Z-debug.log
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/ Using the URLconf defined in pragmatic.urls , Django tried these URL patterns, in this order: admin/ account/ The empty path didn’t match any of these. You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False , and Django will display a standard 404 page. . 밑에는 제 코드 입니다. 밑에 보시는 것 처럼 accoutapp이 추가되어있는데 왜 저런 에러가 발생하는 것인가요? INSTALLED_APPS = [ 'django.contrib.admin' , 'django.contrib.auth' , 'django.contrib.contenttypes' , 'django.contrib.sessions' , 'django.contrib.messages' , 'django.contrib.staticfiles' , 'accountapp' , ]