How do you increase the timeout value for htmlagiliypack? I'm getting this error alot but I want to increase the timeout limit, or how do you kill the request and try again?
resultingHTML = null;
try
{
string htmlstring = string.Empty;
HttpWebRequest newwebRequest = (HttpWebRequest)WebRequest.Create(htmlURL);
HttpWebResponse mywebResponce = (HttpWebResponse)newwebRequest.GetResponse();
if (mywebResponce.StatusCode == HttpStatusCode.OK)
{
Stream ReceiveStream = mywebResponce.GetResponseStream();
using (StreamReader reader = new StreamReader(ReceiveStream))
{
htmlstring = reader.ReadToEnd();
}
HtmlDocument doc = new HtmlDocument();
doc.Load(htmlstring);
HtmlWeb hwObject = new HtmlWeb();
HtmlNode body = doc.DocumentNode.SelectSingleNode("//body");
resultingHTML = body.InnerHtml.ToString();
}
}