티스토리 뷰

selenium 을 이용해서 화면을 캡쳐해본다.

먼저, 사용하고자 하는 브라우저의 버전을 확인해야한다.

 

chrome을 브라우저를 사용할땐, chrome://version 입력하면 버전을 확인 할 수 있다.

확인 후 해당 드라이버를 다운로드 한다.

https://chromedriver.storage.googleapis.com/index.html

 

https://chromedriver.storage.googleapis.com/index.html

 

chromedriver.storage.googleapis.com

from selenium import webdriver
from time import sleep

url = "http://www.naver.com" 

# chromedriver 
driver = webdriver.Chrome("c:/Users/akami/Downloads/chromedriver.exe")
driver.get(url)

# adding the loading time.
sleep(0.1)

# chapture!
driver.save_screenshot("screenshot.png")

# 브라우저를 닫는다.
driver.close()

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함