Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:39:01+00:00 2026-06-11T22:39:01+00:00

I need to login a page which uses captcha image, what I do is:

  • 0

I need to login a page which uses captcha image, what I do is:

1- Download the captcha image using WebClient into memory.

2- Do OCR to the image and extract the code.

3- Post the login details and the code using WebBrowser.

Example:

WebBrowser1.Navigate("URL", "", paramInByte, "Content-Type:application/x-www-form-urlencoded")

I think the WebBrowser requires another captcha image before login and I get wrong code error.
It was working a few months ago so I think they changed the site.
How can I solve this issue? I might need to pass WebClient’s cookies, headers, queries etc to the WebBrowser, but I don’t know how to communicate between them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:39:02+00:00Added an answer on June 11, 2026 at 10:39 pm

    I found this (w is the WebBrowser Object);

    First I set the WebBrowser size to the captcha image size, because the code below will take the visible part in the WebBrowser, but the WebBrowser itself doesn’t have to be visible.

    'scroll to the picture, so we have a WebBrowser object just like a picture box
    For Each i As HtmlElement In w.Document.GetElementsByTagName("img")
        If i.GetAttribute("src").Contains("here string to identify captcha image") Then
            i.ScrollIntoView(True)
        End If
    Next
    
    'Create bitmap
    Dim bmp As New Bitmap(w.Width, w.Height, Imaging.PixelFormat.Format32bppArgb)
    Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp)
    Dim hdc As IntPtr = g.GetHdc
    
    'Do the Drawing
    Dim pUnk As IntPtr = System.Runtime.InteropServices.Marshal.GetIUnknownForObject(w.ActiveXInstance)
    OLE32.OleDraw(pUnk, 1, hdc, New Rectangle(0, 0, w.Width, w.Height))
    System.Runtime.InteropServices.Marshal.Release(pUnk)
    
    'Release DC and dispose
    g.ReleaseHdc(hdc)
    g.Dispose()
    

    Also OLE32 Class should be declared

    Public Class OLE32
        Public Declare Function OleDraw Lib "ole32.dll" (ByVal pUnk As IntPtr, ByVal dwAspect As Integer, ByVal hdcDraw As IntPtr, ByRef lprcBounds As Rectangle) As Integer
    End Class
    

    This way I can get the controls content as bmp and do OCR without requesting new page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the login page: http://www.ifreewind.net/iFreeWind.aspx I need content of this page which need
I am trying to build a small page using django which uses a facebook
I need to login to Amazon page: https://sellercentral-japan.amazon.com/gp/sign-in/sign-in.html/ref=pt_login_lgin_login with PHP cURL (without Amazon Web
I have created login page forced login in several pages. Now i need to
What we need: redirect to each user's specific page after their login. What we
I need to be able to login to a site via Forms Authentication using
We are using the @login_required decorator so that users see a login page if
i try to code a login form which passes username and password to a
I have a login.jsp page which contains a login form. Once logged in the
I've noticed that stackoverflow only uses SSL on the login page, and that questions/answers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.