title: Refresh website with timer in C# - CefSharp
body: <p>I want to create a bot for the website, this site add a part with an <em>id</em>, i want when the part add to site click on this part button.
  My code check a website to find this <em>id</em>, until this <em>id</em> is not found the website is refreshing and when <em>id</em> found, click on the <em>button</em> in website.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public ChromiumWebBrowser browser;
  
  public void InitBrowser()
  {
      timer.Stop();
      browser.Reload();
  
      browser.FrameLoadEnd += (sender, args) =&gt;
      {
          //Wait for the MainFrame to finish loading
          if (args.Frame.IsMain)
          {
              var pageQueryScript = @"
              (function(){
                  var selection = document.querySelector('#test');
                  if (selection !== null) {
                      return '1';
                  }
              })()";
              var scriptTask = browser.EvaluateScriptAsync(pageQueryScript);
              scriptTask.ContinueWith(a =&gt;
              {
                  if (a.Result.Success &amp;&amp; a.Result.Result != null)
                  {
                      timer.Stop();
                      var loginScript = @"document.querySelector('button').click();";
                      browser.EvaluateScriptAsync(loginScript).ContinueWith(b =&gt;
                      {
                          timer.Stop();
                          Console.Write("*");
                      });
                  }
                  else
                  {
                      timer.Start();
                  }
              });
          }
      };
      timer.Start();
  }
  
  public Form1()
  {
      Cef.Initialize(new CefSettings());
      browser = new ChromiumWebBrowser("file:///G:/2.html");
      this.Controls.Add(browser);
      browser.Dock = DockStyle.Fill;
      browser.Height = 500;
      browser.Width = 500;
      browser.Location = new Point(0, 0);
  
      InitializeComponent();
  }
  
  private void timer_Tick(object sender, EventArgs e)
  {
      InitBrowser();
  
  }
  
  private void Form1_Load(object sender, EventArgs e)
  {
      timer.Start();
  }
  </code></pre>
  
  <p>It work correctly <strong>but it click on the button number of website refresh</strong> i want click on this button one time.
  how can i fix this problem.</p>