분류 전체보기
-
[Selenium] 열린 브라우저에서 크롤링 (크롬 디버깅 모드)Memo/Python 2024. 7. 6. 14:19
1. 크롬 디버깅 모드 실행# 실행창(Win + R)에서 실행C:\Program Files\Google\Chrome\Application\chrome.exe --remote-debugging-port=9222 --user-data-dir="C:/ChromeTEMP"# 또는C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --remote-debugging-port=9222 --user-data-dir="C:/ChromeTEMP"# Bat 파일로 제작해 두면 편리하게 실행 가능# 또 다른 방법cd C:\Program Files\Google\Chrome\Application.\chrome.exe --remote-debugging-port=9222 --u..
-
[Selenium] Captcha 이미지 저장. 요소 캡쳐 저장하기Memo/Python 2024. 7. 6. 14:12
Captcha 이미지와 같이 보안 등의 문제로 웹상의 이미지를 파일로 저장하기 어려운 경우가 존재한다.이럴 경우 크롬의 캡쳐 기능을 이용해 원하는 이미지를 손쉽게 저장할 수 있다.img = driver.find_element(By.XPATH, "요소") # 이미지 요소 찾기img.screenshot('image.png') # 이미지 요소 저장 How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver?Currently I'm trying to capture a screenshot using the Selenium WebDriver. But I can only obtain the w..
-
[Selenium] 요소를 찾지 못하는 경우, frame 안의 요소 가져오기Memo/Python 2024. 3. 4. 19:57
평소와 같은 방법으로 페이지의 요소를 가져오려 했다. 그런데 아무리 요소를 검색하여도 "no such element: element not found" 문구가 출력되며 요소를 가져올 수 없었다. 검색해 본 결과 frame(iframe, frameset) 안의 요소를 가져오기 위해서는 frame 안으로 이동하여 요소를 검색해야 했다. frame = driver.find_element(By.TAG_NAME, "frame") # 프레임 요소 선택 driver.switch_to.frame(frame) # 프레임 전환 위와 같이 프레임을 전환해 주니 평소와 같이 요소를 가져올 수 있었다. Selenium에서 #document 안으로 들어가기 Selenium을 이용해 크롤링 하다보면 iframe 안의 내용은 가져오..
-
[Flutter] json 데이터 한글 깨짐 현상. 해결 방법Memo/Dart & Flutter 2024. 2. 22. 22:23
⚠️ 문제 json 데이터를 가져와 출력하는 과정에서 사진과 같이 글자가 깨지는 현상이 발생하였다. 💡 원인 json을 디코딩하는 과정에서 EUC-KR 데이터를 유니코드 기반으로 잘못 해석하여 발생한 문제로 보인다. ✅ 해결 데이터를 UTF-8 방식으로 디코딩하여 해결할 수 있었다. jsonDecode(response.body); // 기존 코드 // to jsonDecode(utf8.decode(response.bodyBytes)); // 개선 코드 🔗 참고 자료 [flutter] 24... jsonDecode(한글깨짐 현상) 마침 지금 공부하는 부분과 프로젝트 부분이 흡사하여 내가 맟은 영역은 아니지만 구현해보았다. 배운거를 복습한다는 느낌으로 따라해보니 스무스하게 잘됐다. 코드에 오류없어 에뮬을 돌..
-
[SQLAlchemy] declarative_base() function is now available as sqlalchemy.orm.declarative_base(). 경고 해결Memo/Python 2024. 2. 19. 17:32
⚠️ 문제 Python 프로젝트를 실행하는 과정에서 아래와 같은 SQLAlchemy 경고 문구가 발생하였다. MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) 💡 원인 'declarative_base' 함수를 import 하는 과정에서 이전 방식을 사용하여 발생한 문제였다. ✅ 해결 아래와 같이 import문을 수정해 해결할 수 있었다. from sqlalchemy.ext.declarative import de..
-
[Firebase] android, plugins {} block 에러 해결Memo/Dart & Flutter 2024. 2. 12. 14:39
⚠️ 문제 Android 앱에 Firebase SDK를 추가하는 과정에서 아래와 같은 에러가 발생하였다. FAILURE: Build failed with an exception. ... See https://docs.gradle.org/7.5/userguide/plugins.html#sec:plugins_block for information on the plugins {} block @ line 33, column 1. plugins { ^ 1 error 💡 원인 Firebase에서 시킨대로 프로젝트 수준의 'build.gradle' 파일에 플러그인을 등록한 것이 문제였다. (Firebase에서 잘못 적어놓은 듯하다..) ✅ 해결 plugins 항목을 'build.gradle'이 아닌, 'setting..
-
[Flutter] PlatformException(null-error, Host platform returned null value for non-null return value., null, null). 에러 해결Memo/Dart & Flutter 2024. 2. 5. 13:22
- 24.02.12. 본 문제는 잘못된 경로에 Firebase SDK 플러그인을 추가하여 발생하는 에러와 관련이 있습니다. 'plugins {} blocks' 에러가 발생하는 경우, google-services를 classpath로 변경하여 적용하지 마시고 아래 게시물을 참조하시기 바랍니다. https://l22hs.tistory.com/59 ⚠️ 문제 Firebase를 연동하기 위해 작성한 main 메소드의 'await Firebase.initializeApp()' 메소드를 실행하는 과정에서 아래와 같은 에러와 함께 애뮬레이터에서는 플러터 로고만 출력되고 앱이 실행되지 않았다. [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception..
-
[Flutter] App requires Multidex support. 에러 해결Memo/Dart & Flutter 2024. 2. 4. 17:49
⚠️ 문제 'cloud_firestore' 패키지를 설치하고 Flutter와 Firebase를 연동하는 과정에서 아래와 같은 에러가 발생하였다. FAILURE: Build failed with an exception. ... [!] App requires Multidex support ... cannot prompt without a terminal ui Exception: Gradle task assembleDebug failed with exit code 1 💡원인 Firebase와 연동하는 과정에서 많은 메서드가 사용되어 발생한 원인으로 생각된다. 안드로이드 공식 문서에서는 메서드가 64K개를 초과하면 멀티덱스 이용이 필요하다고 한다. ✅ 해결 아래와 같이 프로젝트에서 멀티덱스를 활성화하여 해결할 ..