← 전체로 돌아가기
스킬 selenium

Selenium Chrome 자동 종료 방지

Selenium 스크립트 종료 후 Chrome 자동 종료 막기.

seleniumpythonchromedebuggingautomation

Selenium Chrome 자동 종료 방지

스크립트 실행 끝나도 Chrome 브라우저 안 닫히게 하려면 detach 옵션 씀.

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_experimental_option("detach", True)

driver = webdriver.Chrome(options=options, executable_path="path/to/executable")
  • detach: Selenium 스크립트 종료 후에도 Chrome 브라우저 계속 열려있게 함. 디버깅이나 수동 작업 필요할 때 유용.

여기서 배울 것

  1. Selenium Chrome 자동 종료 방지 옵션
  2. `ChromeOptions`에 `detach` 추가
  3. 디버깅/수동 조작 시 브라우저 유지
원본 파일 보기 (.claude/skills/tn-selenium-chrome-detach/SKILL.md)
---
name: Selenium Chrome 자동 종료 방지
description: This skill should be used when the user asks to prevent the Chrome browser from automatically closing after a Selenium script execution, allowing it to remain open for debugging or further manual interaction.
version: 1.0.0
source: /home/son/prj/resume/backup_notes_260317/notion/Tech Note/Selenium if chrome shutdown automatically 9759247a171c4e988a9a777c99e04308.md
---

# Selenium / if chrome shutdown automatically

```python
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_experimental_option("detach", True)

driver = webdriver.Chrome(options=options, executable_path="path/to/executable")
```

[https://stackoverflow.com/questions/58900800/after-executing-selenium-python-code-google-chrome-closes-automatically](https://stackoverflow.com/questions/58900800/after-executing-selenium-python-code-google-chrome-closes-automatically)