Search code examples
c#winformsautomationbrowserfiddler

WebBrowser control do not download images


I am automating the process of downloading my bank statement. The way I do this is by using a win forms WebBrowser control. I navigate to https://www.bankofamerica.com/ then I find the username and password textboxes in the dom fill them in with c# send click event to the submit button etc etc. Eventually I get to the statement I want to download when ready I just parse the page source.

The process works but it is very slow. In summary I will like to improve the performance of this process These are the things I am considering:

  1. Use fiddler to see the requests and responses hoping I could automate the same process. (The problem with this approach is that the connection is encrypted also I have to set cookies and I belive it will be to complicated to do it this way).

  2. Prevent WebBrowser Control from downloading images and css. That way the page.Ready event will fire earlier and the process could be faster.

I will rader go with option number 2 because I know very little about fiddler and just know the basics of http. How can I speed up this process?


Solution

  • It's trivial to capture encrypted traffic with Fiddler; simply enable the Decrypt HTTPS connections option.

    It's also easy to disable download of images from the Web Browser control using the "Ambient DLControl" flags. See http://www.tech-archive.net/Archive/InetSDK/microsoft.public.inetsdk.programming.webbrowser_ctl/2009-01/msg00035.html for an example.