Response to grabbing a Yahoo Captcha even though Yahoo seems to block you from grabbing it with DOM and other methods
TUT [Grabbing Yahoo Captcha]
As Always open VB.net and follow along
What you will need to add to your form.
1 TextBox
1 Button
2 Web Browsers
Oh yeah....PictureBox (thanks LOLland)
In the Button-Click Event we add this code
Code:
Dim captcha1 As HtmlElement
captcha1 = WebBrowser1.Document.GetElementById("cimg")
Dim path As String = captcha1.GetAttribute("src")
TextBox1.Text = path
Dim TextFile As New StreamWriter("test.html")
TextFile.WriteLine("<img src=" & TextBox1.Text & "id" & "=" & "cimg" & " >")
TextFile.Close()
WebBrowser2.Navigate("/test.html")
Dim captcha2 As HtmlElement
captcha2 = WebBrowser1.Document.GetElementById("cimg")
Dim path2 As String = captcha2.GetAttribute("src")
PictureBox1.ImageLocation = path2
What this code does is a concept of thinking outside the box.
It first fetches the URL of the Image location, places it into a a text box, then creates (on the fly) a one page website called Test.html, in this website is one image, the image is the captcha
Thats this part of the code TextFile.WriteLine("<img src=" & TextBox1.Text & "id" & "=" & "cimg" & " >")
Then instead of fetching the captcha from yahoo (because it's blocked)
It fetches it loads your newly created website and loads it's image into the picture box, which happens to be the same as the captcha on yahoo's sign up page.
To make this work for you keep the concept the same, set webbrowser2 visibility to false and modify the code to work in your application (instead of that happening on button 1 , it happens whenever you need it to , have fun)
Hope this helps
[IMG]http://i111.photobucke*****m/albums/n121/golmor/proof-2.jpg[/IMG]
This method will work (should) with any other website preventing you from displaying the captcha, all you need is the ID of the captcha