Jul 8, 2013 09:58 PM
(This post was last modified: Jul 14, 2013 01:11 PM by ScΛrƒΛc3_.)
Hi guys,
dunno if has been already posted, but here it is some code to get the captcha from any page that refresh the captcha image at any request.
Pretty sure will be usefull for someone, so... since i was working on something that needed this, will post to you too.
It works with Google, Hotmail....and you can adapt the code for almost any website.
Remeber to add as Reference "Microsoft.HTML Object Library"
We will be storing the image in the Clipboard, so if you don't want to loose data from it, store the previous content first and restore after you are done.
[img]http://img16.imageshack.us/img16/4589/99xy.jpg[/img]
GOOGLE:
[img]http://img14.imageshack.us/img14/5374/xn3g.jpg[/img]
HOTMAIL:
[img]http://img109.imageshack.us/img109/7614/3xzz.jpg[/img]
Well just forget about captcha issues now...and have a nice day. 🤝
dunno if has been already posted, but here it is some code to get the captcha from any page that refresh the captcha image at any request.
Pretty sure will be usefull for someone, so... since i was working on something that needed this, will post to you too.
It works with Google, Hotmail....and you can adapt the code for almost any website.
Remeber to add as Reference "Microsoft.HTML Object Library"
We will be storing the image in the Clipboard, so if you don't want to loose data from it, store the previous content first and restore after you are done.
[img]http://img16.imageshack.us/img16/4589/99xy.jpg[/img]
GOOGLE:
PHP Code
<?php
Imports mshtml
Public Class Form1
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim CD As IHTMLDocument2 = WebBrowser1.Document.DomDocument
Dim Images As IHTMLControlRange = CType(CD.body, HTMLBody).createControlRange
For Each imgs As IHTMLImgElement In CD.images
If imgs.GetAttribute("src").ToString.Contains("recaptcha") Then
Images.add(imgs)
Images.execCommand("Copy", False, Nothing)
PictureBox1.Image = Clipboard.GetDataObject.GetData(DataFormats.Bitmap)
Exit For
End If
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.Navigate("https://accounts.google.com/SignUp?continue=https%3A%2F%2Fencrypted.google.com%2F&hl=en")
End Sub
End Class
[img]http://img14.imageshack.us/img14/5374/xn3g.jpg[/img]
HOTMAIL:
PHP Code
<?php
Imports mshtml
Public Class Form1
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim CD As IHTMLDocument2 = WebBrowser1.Document.DomDocument
Dim Images As IHTMLControlRange = CType(CD.body, HTMLBody).createControlRange
For Each imgs As IHTMLImgElement In CD.images
If imgs.GetAttribute("src").ToString.Contains("GetHIPData?hid=") Then
Images.add(imgs)
Images.execCommand("Copy", False, Nothing)
PictureBox1.Image = Clipboard.GetDataObject.GetData(DataFormats.Bitmap)
Exit For
End If
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
WebBrowser1.Navigate("https://signup.live.com/signup.aspx?lic=1")
End Sub
End Class
[img]http://img109.imageshack.us/img109/7614/3xzz.jpg[/img]
Well just forget about captcha issues now...and have a nice day. 🤝


![[Image: Lymnm1L.jpg]](https://i.imgur.com/Lymnm1L.jpg)

