Foro de elhacker.net

Programación => .NET (C#, VB.NET, ASP) => Mensaje iniciado por: TrashAmbishion en 25 Junio 2012, 18:28 pm



Título: Capturar Captcha !!
Publicado por: TrashAmbishion en 25 Junio 2012, 18:28 pm
Amigos vengo en busca de ideas para capturar un captchat de una web la etiqueta "img" no tiene el parametro ID los únicos parametros que tiene son el ancho y el alto, y lo otro es que el tipo de imagen que se muestra es ".png" no hay ninguna otra imagen en la web con esa extension, alguna idea de como podre capturarlo y mostrarlo en picturebox o webbrowser... ayuda...

encontre el siguiente ejemplo pero no lo entiendo bien si alguien pudiera desmenuzarlo un poco mas...

Código
  1.  
  2. '1) Put this Sub in your Project.
  3. 'You need:
  4.  
  5. '    PictureBox --> name = PictureBox1
  6. '    WebBrowser --> name = WebBrowser1
  7.  
  8.  
  9. 'getcaptcha()
  10. 'Code:
  11. Public Sub getcaptcha()
  12.  Dim str As String = WebBrowser1.Document.GetElementById("recaptcha_image").InnerHtml 'Gets the html code for the recaptcha_image element
  13.  Dim img As String = str.Remove(0, 33).Replace(""" width=300 height=57>", "") 'Deletes all the info around the link because the height and width will never change
  14.  PictureBox1.ImageLocation = img 'Sets the ImageLocation to the URL of the ReCaptcha Image
  15.    End Sub
  16.  
  17. 'Then find the WebBrowser1 Document Completed Sub (shown below)
  18. 'Code:
  19. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  20.  
  21.  End Sub
  22.  
  23. 'And Add this code below to the Sub Above ^^
  24. 'Code:
  25. If WebBrowser1.DocumentTitle.Contains("Emk") Then
  26.    getcaptcha() 'Runs the sub getcaptcha()
  27.  End If
  28.  
  29. 'So it would look like this
  30. 'Code:
  31. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  32.  
  33.    getcaptcha() 'Runs the sub getcaptcha()
  34.  
  35.  End Sub
  36.  
  37. 'Read more: http://codertrick.blogspot.com/2011/07/get-captcha-image-in-picturebox-vbnet.html#ixzz1yo8AV2rM
  38.  
  39.  
  40.  


Título: Re: Capturar Captcha !!
Publicado por: USLO en 28 Junio 2012, 11:22 am
 Hola buenas!
A ver si me entero, quieres capturar la imagen de un captcha para a posteriory meterlo en un objeto?Y luego pasarle un OCR?
Sabes lo dificil que es hacer ocr a CAPTCHAS?

Trabajo ena empresa de digitalizacion y hacemos OCR ;el ocr funciona pero a la minima que haya algo por medio una rayao polvo o demsaidada luz etc,Falla el Reconocimiento de OCR, por lo que hay que hacer muchos filtros!

La verdad esque es una idea muy buena, pero nada sencila y muy laburiosa.

librerias de ocr (Libtools (Pago)Con filtros, tecerac de google(Gratuito)(pocos filtros))
Saludos