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?

2

1 Answer 1

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#

3

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.