title: How to access elements with CEFSharp?
body: <p>I am working with CEFSharp C# for the first time and im having a hard time figuring out how to make the browser do anything but browser.Load("");
  I have been searching many websites for hours and hours and nobody seems to have an answer or have this problem. I am trying to access the website elements as if they were c# form controls... in a nutshell. I'm not supposed to ask broad questions... how would I do something like <code>browser.Click("/*elementName*/")</code>? Is Also, is there no way to do something like <code>browser.TextBox1.Text = "blah";</code>?</p>
  
  <p>@Jim W</p>
  
  <p>my code so far: updated 6/6/2018 4:29 pm</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using CefSharp;
  using CefSharp.WinForms;
  
  namespace WebAppWorkAround
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
              InitializeChromium();
          }
          List&lt;string&gt; classList = new List&lt;string&gt;();
          public ChromiumWebBrowser chromeBrowser;
  
          private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
          {
  
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
  
          }
          private void InitializeChromium()
          {
              CefSettings settings = new CefSettings();
              Cef.Initialize(settings);
              chromeBrowser = new ChromiumWebBrowser("https://en.wikipedia.org/wiki/Main_Page");
              this.panel1.Controls.Add(chromeBrowser);
              chromeBrowser.Dock = DockStyle.Fill;
  
          }
  
          private void Form1_FormClosing(object sender, FormClosingEventArgs e)
          {
              Cef.Shutdown();
          }
          public string extract;
  
          private void button1_Click(object sender, EventArgs e)
          {
  
              string EvaluateJavaScriptResult;
              var frame = chromeBrowser.GetMainFrame();
              var task = frame.EvaluateScriptAsync("(function() { return document.getElementById('aaa').value; })();", null);
  
              task.ContinueWith(t =&gt;
              {
                  if (!t.IsFaulted)
                  {
                      var response = t.Result;
                      EvaluateJavaScriptResult = response.Success ? (response.Result ?? "null") : response.Message;
                  }
              }, TaskScheduler.FromCurrentSynchronizationContext());
  
  
  
  
  
          }
      }
  }
  </code></pre>
  
  <p>errors:</p>
  
  <p>Error   CS1061  'Task' does not contain a definition for 'Result' and no extension method 'Result' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?)   (line 61)</p>
  
  <p>Error   CS0266  Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?) (line 62)</p>