Python
-
ImportError: cannot import name 'mesh_core_cython위와 같은 에러가 났다면 userpath/face3d/mesh/cython 경로로 들어가서 아래처럼 setup 파일을 install 해주세요! cd ./engineer/render/face3d/mesh/cython # !!각자의 face3d 라이브러리 path 맞춰줍시다python setup.py build_ext --inplacepython setup.py install
ImportError: cannot import name 'mesh_core_cython'ImportError: cannot import name 'mesh_core_cython위와 같은 에러가 났다면 userpath/face3d/mesh/cython 경로로 들어가서 아래처럼 setup 파일을 install 해주세요! cd ./engineer/render/face3d/mesh/cython # !!각자의 face3d 라이브러리 path 맞춰줍시다python setup.py build_ext --inplacepython setup.py install
2024.06.18 -
성능에 대해서는 프로그램을 만들고 나서나 기능 개발이 완료되고 나서나 작동이 잘되는것을 확인했는데 속도가 아쉽다면 항상 고민을 하게 됩니다.우리는 더 나은 품질에 빠릿빠릿한 프로그램을 원하니까요!프로그램이 원할하게 돌아가게 하기 위해선 Frontend에서의 부드러움도 중요하지만 그만큼 Backend 및 자동화를 위한 스크립트에서도 빠른 속도가 바쳐줘야 합니다. 이글은 제가 많은 시도 끝에 성능을 올려본 방법론중에 하나이며 스스로도 추후에 참고하고 싶어 기록을 남겨봅니다.속도가 문제가 되는곳에는 그만큼 거대한 연산작업이 있다는것입니다. 그 거대한 연산작업을 기다리지 않고 병렬로 처리한다면 사용자는 우선적으로 결과값을 바로 받을 수 있어 사용성에 부드러움을 느낄 수 있습니다. 그 병렬처리를 위해 동시프로그래..
(Python 성능 향상) concurrent.futures 동시 프로그래밍 모듈로 속도 개선해보자!성능에 대해서는 프로그램을 만들고 나서나 기능 개발이 완료되고 나서나 작동이 잘되는것을 확인했는데 속도가 아쉽다면 항상 고민을 하게 됩니다.우리는 더 나은 품질에 빠릿빠릿한 프로그램을 원하니까요!프로그램이 원할하게 돌아가게 하기 위해선 Frontend에서의 부드러움도 중요하지만 그만큼 Backend 및 자동화를 위한 스크립트에서도 빠른 속도가 바쳐줘야 합니다. 이글은 제가 많은 시도 끝에 성능을 올려본 방법론중에 하나이며 스스로도 추후에 참고하고 싶어 기록을 남겨봅니다.속도가 문제가 되는곳에는 그만큼 거대한 연산작업이 있다는것입니다. 그 거대한 연산작업을 기다리지 않고 병렬로 처리한다면 사용자는 우선적으로 결과값을 바로 받을 수 있어 사용성에 부드러움을 느낄 수 있습니다. 그 병렬처리를 위해 동시프로그래..
2024.06.17 -
Selenium은 웹 브라우저를 자동으로 제어하여 웹페이지를 테스트하고 조작할 수 있게 해주는 프레임워크입니다. 특히 웹 개발자와 QA 엔지니어에게 매우 인기 있는 도구 중 하나입니다. Selenium의 주요 특징: 다양한 언어 지원: Java, Python, C#, Ruby, JavaScript 등 다양한 프로그래밍 언어에서 사용할 수 있습니다. 브라우저 호환성: 대부분의 주요 웹 브라우저(Chrome, Firefox, Safari, Edge 등)와 호환됩니다. 또한 각 브라우저마다의 WebDriver를 제공하여 해당 브라우저를 자동으로 제어할 수 있습니다. 다양한 플랫폼 지원: Windows, macOS, Linux 등 다양한 운영 체제에서 사용할 수 있습니다. 다양한 웹 테스팅 기능: 웹페이지의 요..
[파이썬 웹크롤링 기초] selenium 소개 및 사용법 1탄Selenium은 웹 브라우저를 자동으로 제어하여 웹페이지를 테스트하고 조작할 수 있게 해주는 프레임워크입니다. 특히 웹 개발자와 QA 엔지니어에게 매우 인기 있는 도구 중 하나입니다. Selenium의 주요 특징: 다양한 언어 지원: Java, Python, C#, Ruby, JavaScript 등 다양한 프로그래밍 언어에서 사용할 수 있습니다. 브라우저 호환성: 대부분의 주요 웹 브라우저(Chrome, Firefox, Safari, Edge 등)와 호환됩니다. 또한 각 브라우저마다의 WebDriver를 제공하여 해당 브라우저를 자동으로 제어할 수 있습니다. 다양한 플랫폼 지원: Windows, macOS, Linux 등 다양한 운영 체제에서 사용할 수 있습니다. 다양한 웹 테스팅 기능: 웹페이지의 요..
2024.03.23 -
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path' driver = webdriver.Chrome(executable_path=driver_path, options=options) 위의 코드로 driver path를 들고올 경우 에러가 납니다. from selenium import webdriver from selenium.webdriver.chrome.service import Service driver_path = "chromedriver path" # WebDriver의 경로 설정 service = Service(executable_path=driver_path) options = webdriver...
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path' driver = webdriver.Chrome(executable_path=driver_path, options=options) 위의 코드로 driver path를 들고올 경우 에러가 납니다. from selenium import webdriver from selenium.webdriver.chrome.service import Service driver_path = "chromedriver path" # WebDriver의 경로 설정 service = Service(executable_path=driver_path) options = webdriver...
2024.03.23 -
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath' 위와 같은 에러가 난다면 현재 xpath사용법이 바뀌어서 그렇습니다. (X) element = driver.find_element_by_xpath('//*[@id="content"]/div[1]') (O) from selenium.webdriver.common.by import By element = driver.find_element(By.XPATH, '//*[@id="content"]/div[1]') selenium 4.18.1 기준 위의 코드로 바꿔주시면 잘 작동될것입니다.
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath' 위와 같은 에러가 난다면 현재 xpath사용법이 바뀌어서 그렇습니다. (X) element = driver.find_element_by_xpath('//*[@id="content"]/div[1]') (O) from selenium.webdriver.common.by import By element = driver.find_element(By.XPATH, '//*[@id="content"]/div[1]') selenium 4.18.1 기준 위의 코드로 바꿔주시면 잘 작동될것입니다.
2024.03.23 -
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 123.0.6312.58 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 위와 같이 Selenium 웹 드라이버 경로 지정 사용할때 오류가 뜰 수 있습니다. 현재 크롬 버전이 웹드라이버 버전이랑 맞지 않아서 그렇습니다. https://googlechromelabs.github.io/chrome-for-test..
selenium.common.exceptions.SessionNotCreatedException Current browser version is 123.0.6312.58 with binary pathselenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 123.0.6312.58 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 위와 같이 Selenium 웹 드라이버 경로 지정 사용할때 오류가 뜰 수 있습니다. 현재 크롬 버전이 웹드라이버 버전이랑 맞지 않아서 그렇습니다. https://googlechromelabs.github.io/chrome-for-test..
2024.03.23 -
파이썬으로 네이버에 검색된 최신 뉴스를 크롤링 해봅시다. 여러분은 매일 확인하는 뉴스가 있나요? 특히 검색해서 확인하는 키워드가 있다면 이번 포스팅은 정말 큰 도움이 될것입니다. 코드부터 바로 볼게요! from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time # step1. 검색할 키워드 입력 query = input('검색 키워드 입력:') time.sleep(5) # step2. 크롬드라이버로 원하는 url 접속 url = 'https://www.naver.com' driver = webdriver.Chrome() dr..
(파이썬 웹크롤링) 네이버 뉴스 크롤링파이썬으로 네이버에 검색된 최신 뉴스를 크롤링 해봅시다. 여러분은 매일 확인하는 뉴스가 있나요? 특히 검색해서 확인하는 키워드가 있다면 이번 포스팅은 정말 큰 도움이 될것입니다. 코드부터 바로 볼게요! from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time # step1. 검색할 키워드 입력 query = input('검색 키워드 입력:') time.sleep(5) # step2. 크롬드라이버로 원하는 url 접속 url = 'https://www.naver.com' driver = webdriver.Chrome() dr..
2024.03.21 -
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home 이미지 크롤링 스크립트를 간만에 돌릴려고하면 한번씩 이런 에러가 뜨곤 합니다. selenium과 webdriver-manager 패키지 버전을 최신화하면 해결이 됩니다. pip install selenium pip install webdriver-manager 24.3.21 기준 아래의 버전으로 최신화해주니 정상작동 되었습니다. selenium 4.18.1 webdriver-manager 4.0.1
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/homeselenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home 이미지 크롤링 스크립트를 간만에 돌릴려고하면 한번씩 이런 에러가 뜨곤 합니다. selenium과 webdriver-manager 패키지 버전을 최신화하면 해결이 됩니다. pip install selenium pip install webdriver-manager 24.3.21 기준 아래의 버전으로 최신화해주니 정상작동 되었습니다. selenium 4.18.1 webdriver-manager 4.0.1
2024.03.21