개발환경
Python version : 3.9
Selenium version : 4.1.0
Chrome driver verison : Latest stable release: ChromeDriver 97.0.4692.71
python + selenium을 아래 코드로 작성하니 deprecated warning이 떴다
from selenium import webdriver
driver = webdriver.Chrome(executable_path='/Users/buri/Downloads/chromedriver')
driver.get(url)
console output:
DeprecationWarning:
executable_path has been deprecated, please pass in a Service object
해결 :
webdriver-manager 설치 하기 : pip install webdriver-manager
코드 수정
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get(url)
console output:
====== WebDriver manager ======
Current google-chrome version is 97.0.4692
Get LATEST chromedriver version for 97.0.4692 google-chrome
There is no [mac64] chromedriver for browser in cache
Trying to download new driver from https://chromedriver.storage.googleapis.com/97.0.4692.71/chromedriver_mac64.zip
Driver has been saved in cache [/Users/buri/.wdm/drivers/chromedriver/mac64/97.0.4692.71]
'backend' 카테고리의 다른 글
[Docker] no space left on device 해결 - Mac (0) | 2024.01.19 |
---|---|
[IntelliJ] Big Data Tools - Kafka IntelliJ Plugin (1) | 2023.08.23 |
[책] 함수형 사고 - Chapter 2. 전환 - 2.4 골치 아프게 비슷비슷한 이름들. (0) | 2018.07.22 |
[책] 함수형 사고 - Chapter 2. 전환 (0) | 2018.07.22 |
[책] 함수형 사고 - Chapter 1. 왜 (0) | 2018.07.15 |
테스트 코드 작성 관련 링크 (0) | 2010.02.08 |
[Jersey] WebApplicationException and Mapping Exception to Responses (0) | 2009.07.30 |
[Jersey] Building Responses (4) | 2009.07.21 |