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

  • SEARCH
  • Home
  • 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 8010691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:48:59+00:00 2026-06-04T18:48:59+00:00

Hi i have a c# IE automation script and i am trying to retrieve

  • 0

Hi i have a c# IE automation script and i am trying to retrieve the image from a HTMLImgClass, i cant get the image from cache because its not saved and i cant just resend a request to the src because a new image returns, so i need a way to access the Image in the browsers memory.

captcha_image = (HTMLImgClass)GetElementByPosition("img", 0, ie1);

The object is retreived with the above assignement, which works fine, but i have no idea which of the methods available i can use to get the image.

Thanx for your time

SOLVED
For others interested, i solved it this way, i decided to copy the image to clipboard and then save it as a bmp

captcha_image = (HTMLImgClass)GetElementByPosition("img", 0, ie1);
                                    IHTMLImgElement captcha_image1 = (IHTMLImgElement)captcha_image;
                                    IHTMLDocument2 doc = (IHTMLDocument2)wb1.Document;
                                    IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)doc.body).createControlRange();
                                    imgRange.add((IHTMLControlElement)captcha_image1);

                                    imgRange.execCommand("Copy", false, null);
                                    using (Bitmap bmp = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap))
                                    {
                                        bmp.Save(@"C:\skt.bmp");
                                    }
  • 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-04T18:49:00+00:00Added an answer on June 4, 2026 at 6:49 pm

    I’m assuming that this is related to your other question. As suggested in my answer there, if the image hasn’t been saved to disk cache, you won’t be able to access it there.

    A solution is to force your browser to go through a proxy for all requests, and therefore to store the captcha images as they are being requested in the first place. I’ve used Fiddler2 for this in the past.

    In Fiddler2, you can change the OnBeforeResponse hook to save the image by code similar to the following:

        if (oSession.uriContains("captcha")){      // change as needed
            oSession.utilDecodeResponse();
            var filename = oSession.url;           // get an appropriate file name
            oSession.SaveResponseBody(filename);   // store the file
        }
    

    Now as long as the file being saved by this script can later be found by your program (usually by keying off something in the URL), you’re in business.

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

Sidebar

Related Questions

I have a UI Automation script, written in JavaScript. From that script, how do
I have a fairly long and complex build automation script. From a configuration management
I have been trying to run some java programs from a bash script in
I have a power-shell script with which I am trying to back up a
I have a xulrunner application and I've been trying to reference remote content from
I have written a simple shell script to do some automation work. Basically the
I have a Powershell script that is going to be run through an automation
I have an Internet Explorer automation script in c#, it works ok but I
am trying to use automation in from Microsoft Access 2003 to control Internet Explorer
I have an automation system and I would like to record user logins and

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.