3

Im trying to connect to a website and for that I need a "browser" which has (enabled) JavaScript, otherwise the server denies the connection (in the HTML file stands sth like "...enable JavaScript to see full page..."). Has someone an idea how can activate JavaScript?

void connect (string url){
  WebBrowser wb = new WebBrowser();
  //this enables JavaScript?
  wb.ObjectForScripting = true;      

  wb.Navigate(new Uri(url));

  //I know this could be an endless while 
  while (wb.ReadyState != WebBrowserReadyState.Complete)
  {
    System.Windows.Forms.Application.DoEvents();
  }      

  HtmlDocument doc = wb.Document;

  Console.Write(wb.DocumentText);
}
Ian
  • 35
  • 1
  • 6

0 Answers0