0
                using (WebClient wc = new WebClient())
            {
                wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows; Windows NT 5.1; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4");
                string html = wc.DownloadString("https://www.dividends.sg/view/D05");
                HtmlDocument doc = new HtmlDocument();
                doc.LoadHtml(html);
            }

error is below

$exception  {System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) …} System.Net.WebException

i tried using bs4 and it worked when i add useragent but i have switch to c# currently and i have no idea if this is a correct way to do so.

  • Please read [ask] and share your research. Do you understand the exception message? What have you tried to resolve it? – CodeCaster Feb 11 '17 at 14:04
  • i dont quite understand your suggested answer, the code worked perfectly fine with morningstar dividend webpage. just now this specific webpage. – OOI YI YONG Feb 11 '17 at 14:31

0 Answers0