Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: C#: .NET based webbrowser doesn't show image

Rohit:

I am new in C# language and I have been trying to automate a website using .NET based Webbrowser for ONLY personal use in Visual Studio 2015.

I have done document parsing, used Timer, used DocumentCompleted event properly to wait for the webpage to Load completely and then parse the content, tried to make async events to behave like sync events (in order to load HTML content generated by clicking a link in a fully loaded webpage), etc to go through the phases in webpage automation: login -> get trains between stations -> click the Book now link -> go to the next page and fill in the passenger details.

Everything works fine but I am now stuck at the last phase, i.e., "go to the next page and fill in the passenger details" has a captcha image that must be resolved to go to the payment page. Don't get me wrong because I am not trying to get this captcha resolved automatically. The problem here is that I do not see the captch image which turned to be loaded only when this javascript call is invoked $(document).ready.

I thought my project has some buggy code which is stopping to load the captcha and therefore, I created a very basic new project, only added below code and navigated through different phases myself to see if the captcha really loads but unfortunately it would not load.


namespace TestWebBrowser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
webBrowser1.Navigate("http://ift.tt/1lySkx7");
}

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{

}
}
}

Please see below. The highlighted part is where I am expecting a captcha.

I must tell you that I am not a web designer and therefore I only understand very basic of how websites work.

I went through several questions on this forum and nothing helped me.

Internet explorer is also using .NET browser from behind but while using IE, I can see the captcha is getting loaded. So, why is this javascript call $(document).ready is not getting invoked in .NET browser. Please see below:

I have later tried to use CefSharp in a fresh new project and I can see the captcha is getting loaded in its chromium based webbrowser. But I have done so much coding with .NET based webbrowser already and therefore I want to stick to the latter at this moment in order to get this resolved.

Is this happening because .NET webbrowser is using some very old IE version configurations?

Please help me to understand.

UPDATE 1: Adding the javascript






Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: C#: .NET based webbrowser doesn't show image

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×