본문 바로가기
Python/Selenium

[Selenium] 브라우저 종료하지 않고 유지하기

by pcm9881 2023. 5. 1.

selenium.webdriver.chrome.optins Options중에서 add_experimental_option을 사용해서

브라우저 종료하지않고 유지하게 할 수 있습니다. 

 

예제

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_experimental_option("detach", True)

driver = webdriver.Chrome('./chromedriver', options=options)

 

참조

[selenium excluding-arguments]: https://www.selenium.dev/documentation/webdriver/browsers/chrome/#excluding-arguments

 

Chrome specific functionality

These are capabilities and features specific to Google Chrome browsers.

www.selenium.dev

[selenium webdriver chrome options]: https://www.selenium.dev/selenium/docs/api/py/webdriver_chrome/selenium.webdriver.chrome.options.html

 

selenium.webdriver.chrome.options — Selenium 4.9 documentation

Returns:Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)

www.selenium.dev

 

728x90

댓글