분류 전체보기
-
이 문제는 아마 업데이트 연산자를 지정하지 않아서 발생 했을것 입니다 .예를 들어 값을 사용하려면 $set을 사용하세요. before)collection.update_one({"_id": "fh98h43f89fh4fh"}, {"some_field": "some update"}) after)collection.update_one({"_id": "fh98h43f89fh4fh"}, {"$set": {"some_field": "some update"}})
ValueError: update only works with $ operators이 문제는 아마 업데이트 연산자를 지정하지 않아서 발생 했을것 입니다 .예를 들어 값을 사용하려면 $set을 사용하세요. before)collection.update_one({"_id": "fh98h43f89fh4fh"}, {"some_field": "some update"}) after)collection.update_one({"_id": "fh98h43f89fh4fh"}, {"$set": {"some_field": "some update"}})
2024.05.20 -
Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted 위 처럼 에러가 나는 경우는 useRouter를 next/router에서 가져와서 생긴 문제입니다. NEXT.js 13 이상 버전은 next/router가 아닌 next/navigation에서 useRouter를 가져와야 합니다. 다음 코드를 참조해주세요. 'use client' import { useRouter } from 'next/navigation' export default function Page() { const router = useRouter() return ( router.push('/dashboard')}> Dashboar..
Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mountedError: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted 위 처럼 에러가 나는 경우는 useRouter를 next/router에서 가져와서 생긴 문제입니다. NEXT.js 13 이상 버전은 next/router가 아닌 next/navigation에서 useRouter를 가져와야 합니다. 다음 코드를 참조해주세요. 'use client' import { useRouter } from 'next/navigation' export default function Page() { const router = useRouter() return ( router.push('/dashboard')}> Dashboar..
2024.03.28 -
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