-
[Selenium] Captcha 이미지 저장. 요소 캡쳐 저장하기Memo/Python 2024. 7. 6. 14:12
Captcha 이미지와 같이 보안 등의 문제로 웹상의 이미지를 파일로 저장하기 어려운 경우가 존재한다.
이럴 경우 크롬의 캡쳐 기능을 이용해 원하는 이미지를 손쉽게 저장할 수 있다.
img = driver.find_element(By.XPATH, "요소") # 이미지 요소 찾기 img.screenshot('image.png') # 이미지 요소 저장
How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver?
Currently I'm trying to capture a screenshot using the Selenium WebDriver. But I can only obtain the whole page screen shot. However, what I wanted is just to capture a part of the page or perhaps ...
stackoverflow.com
'Memo > Python' 카테고리의 다른 글
[Selenium] 열린 브라우저에서 크롤링 (크롬 디버깅 모드) (0) 2024.07.06 [Selenium] 요소를 찾지 못하는 경우, frame 안의 요소 가져오기 (0) 2024.03.04 [SQLAlchemy] declarative_base() function is now available as sqlalchemy.orm.declarative_base(). 경고 해결 (0) 2024.02.19 [Python] 'utf-8' codec can't decode byte 0xbe 에러 해결 (0) 2023.02.17 [Python] 텔레그램 API로 메시지 전송 방법 (마크다운, 이모지, 버튼) (0) 2023.02.13