S
S
Sasha Pleshakov2016-10-24 00:30:41
C++ / C#
Sasha Pleshakov, 2016-10-24 00:30:41

Why doesn't the InvokeMember method of the WebBrowser class work?

using (WebBrowser webBrowser = new WebBrowser())
{                         
    webBrowser.Navigate("http://109.167.224.169/cgi-bin/tcgi1.exe?dialogstart"); // документ загружается
    while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
        Application.DoEvents();
    webBrowser.Document.GetElementById("1").InvokeMember("Сlick");//текст документа остается прежним
    while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
        Application.DoEvents();
    StreamReader streamReader = new StreamReader(webBrowser.DocumentStream,
                                                Encoding.GetEncoding("windows-1251"));
    Console.WriteLine(streamReader.ReadToEnd());         
}

What can be wrong? I tried different ways from internet.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-10-24
@Rou1997

You haven't tried anything!
Why didn't you make a unit test (create your own test page with such a button)?
Why didn't you try to send submitinstead click?
Why haven't you tried other headless browsers besides Internet Explorer?
Why didn't they try raw HTTP - I don't ask.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question