0

I am using HTML Agility Pack library to read page's HTML, but facing this error:

Unable to read data from the transport connection the connection was closed.

Here's my code:

var getHtmlWeb = new HtmlWeb();

for (int j = 0; j < arr.Length; j++)
{
    var document = getHtmlWeb.Load(arr[j].ToString());  // error line
}

how can I extend the Timeout?

Nasreddine
  • 36,610
  • 17
  • 75
  • 94
Sanjay Bathre
  • 451
  • 1
  • 5
  • 17
  • 1
    http://stackoverflow.com/questions/6574109/how-to-timeout-a-request-using-html-agility-pack – bansi Nov 18 '14 at 13:18
  • thanx for the reply @bansi i have got my solution here: http://refactoringaspnet.blogspot.in/2010/04/using-htmlagilitypack-to-get-and-post.html – Sanjay Bathre Nov 19 '14 at 07:41

1 Answers1

1

I suggest that you get the html/texts first to your local machine before you load it to your agility pack. you can use HttpWebRequest it has timeout property if you really need to adjust it.

look on this >> How can I download HTML source in C#

Community
  • 1
  • 1