0

Hello I'm looking to check for an element within an html document within a CefSharp browser. CefSharp is an embeded, full-featured standards-complaint web browser for C# / .NET website here

Previously, You where able to check for html element ID's via this method:

If (Form2.WebBrowser1.Document.GetElementById("getnamehistory_arrow") IsNot Nothing) Then

End if

I have gone through some of the Frequently asked questions sections of the GitHub but cannot find anything that relates. If anyone here if familiar with CefSharp please feel free to give suggestions!

Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
John Kens
  • 33
  • 1
  • 7

1 Answers1

0

It is in c# but it works..

        string script = string.Format("$('getnamehistory_arrow').length;");
        browser.EvaluateScriptAsync(script).ContinueWith(x =>
        {
            var response = x.Result;

            if (response.Success && response.Result != null)
            {
                var resultres = Convert.ToString(response.Result);
                if (resultres == "1")
                {
                    //have 
                }
                else
                {
                    //don't have
                }
            }
        });
Elvin Chu
  • 150
  • 1
  • 8