Click here to Skip to main content
15,912,457 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi!
i want to create a C# app which automatically download captcha images from a website. can somebody tells me how is it possible.?
Posted
Comments
Ed Nutting 19-Feb-12 5:50am    
Why do you want to automatically download other websites CAPTCHA images? CAPTCHA images are normally (or at least should) be randomly generated for every request meaning no two are the same (pretty much..) so you could spend eternity trying to download all the CAPTCHA images - there are theoretically infinitely many. I suggest you try searching CP or Google for CAPTCHA image generation.

Hope this helps,
Ed
saifullahiit 19-Feb-12 6:01am    
what i want is to create a widows form. put browser controls on it, and a button. a webpage will be open in the windows form containing captcha images when i click on the button it save only captcha image from webpage into local drive.
Dave Kreskowiak 19-Feb-12 14:27pm    
What's the point of doing this??
Aniket Yadav 19-Feb-12 6:21am    
The captcha image will change for every request. So downloading and then submitting again may not work. One option is to have a web browser control, load this webpage and fill out the form fields programatically and then wait for the user to enter captcha and then submit the form.
Ileny Francis 8-Jul-21 19:18pm    
What's my chaptcha code to ilenyfrancis605@gmail.com

If you know the id of the captcha element for a certain website you can get it's src attribute and download from the url.
Here is an example of a captcha img in a div tag with the id "recaptcha_image".
HTML
<div id="recaptcha_image" style="width: 300px; height: 57px; "><img style="display:block;" alt="reCAPTCHA challenge image" height="57" width="300" src="http://www.google.com/recaptcha/api/image?c=03AHJ_Vus407GuhxqGfVSZawlQp2afR8Ov0GI0zpZolxeHbjXa5dRThbO0XWzAduWq5P7JNzA99oGPLSjuWQtnKotfv4Jy0EwkXBZv9kj9531F6YEwSop56pRTh4hOsWnO7n-CxLtH_w4pKC6OpRdw3KZZOXjgts3-Dg"></img></div>

Here is an example of how to get the image with a windows forms browser:
C#
HtmlElement ele = browser.Document.GetElementById("recaptcha_image");
if (ele != null)
{
    string imageSource = ele.GetAttribute("src");
}
 
Share this answer
 
v2
No, there is no automatic way to do that - a Captcha image is just an image like any other. There is nothing which marks this as a "Captcha" image, rather than a "Company logo" image instead.
 
Share this answer
 
I want to download all of chaptcha images into my app, from a website, why?! Because I write a chaptcha solver and what is the benefit if it couldn't get all the image sources automatically?!
Any idea will be welcome.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900