Python

selenium 4 에서 바뀐 부분들

Jack Moon 2022. 3. 24. 11:26

게을러서 제대로 정리를 못했는데 잘 정리되어 있는 페이지가 있어 링크 겁니다.

https://wikidocs.net/177133

 

1. executable_path has been deprecated, please pass in a Service object 경고가 뜬다면

 

Selenium4 에서는 Service 개체에 executable_path를 설정해야 합니다.
https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/

 

Upgrade to Selenium 4

Are you still using Selenium 3? This guide will help you upgrade to the latest release!

www.selenium.dev

from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
options = webdriver.ChromeOptions()
s = ChromeService(executable_path='/home/python/chromedriver')
driver = webdriver.Chrome(service=s, options=options)