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);
}
错误低于
$exception {System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) …} System.Net.WebException
我尝试使用bs4并且当我添加useragent时它工作但我现在切换到c#并且我不知道这是否是正确的方法。