selenium으로 크롬 하드웨어 가속 끄기 - Python

SuYeong·2022년 1월 28일
1

selenium 하드웨어 가속 끄기

selenium으로 하드웨어 가속을 꺼보도록 하겠다.

해결방법

굉장히 간단하다

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--disable-gpu')

driver = webdriver.Chrome(options=options)

driver.get("https://www.google.com/")

ChromeOptions()로 객체를 만들고,
생성된 객체에 원하는 옵션을 입력한다.

options를 드라이버의 생성자에 넘겨주면 끝이다.

그리고 get으로 웹을 열어서 확인해보면,
하드웨어 가속이 꺼진 효과가 난다.

(단, 크롬의 설정창에 직접 들어갔을때는, 하드웨어 가속이 켜져있다고 표시된다. 하지만 실제로는 꺼져있다)

profile
안녕하세요

1개의 댓글

comment-user-thumbnail
2022년 3월 2일

답글을 달아보도록 하겠다.
간단하다.

답글 달기