Captcha Cracker #13
cyberprophet
started this conversation in
General
Replies: 3 comments 1 reply
-
<div class="spicker">
<div class="sp_left">
<img
id="captchaImg"
title="캡챠이미지"
alt="캡챠이미지"
src="/rep/cm/captchaImg.do"
/>
</div>
<div id="captchaAudio" style="display: none"></div>
<div class="sp_right">
<a
href="javascript:;"
onclick="javascript:fn_clickRefreshCaptcher('/rep/cm/captchaImg.do?_csrf=11068f05-67e0-48ce-84ff-236f386b4d12');"
title="새로고침"
><img
src="https://image.foresttrip.go.kr/images/content/capcha_refrash.png"
alt=""
/><span class="hide">새로고침</span></a
>
<a
href="javascript:;"
onclick="javascript:fn_clickListen('/rep/cm/captchaAudio.do?_csrf=11068f05-67e0-48ce-84ff-236f386b4d12');"
title="듣기"
><img
src="https://image.foresttrip.go.kr/images/content/capcha_spicker.png"
alt=""
/><span class="hide">듣기</span></a
>
</div>
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
-
var captchaElement = driver.FindElement(By.Id("captchaImg"));
// JavaScript를 이용해서 img의 Base64 데이터를 추출
string base64Image = (string)((IJavaScriptExecutor)driver).ExecuteScript(
"var img = arguments[0]; " +
"var canvas = document.createElement('canvas'); " +
"canvas.width = img.width; " +
"canvas.height = img.height; " +
"var ctx = canvas.getContext('2d'); " +
"ctx.drawImage(img, 0, 0, img.width, img.height); " +
"return canvas.toDataURL('image/png').substring(22);",
captchaElement);
// Base64 문자열을 바이트 배열로 변환
byte[] imageBytes = Convert.FromBase64String(base64Image); |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions