Hey,
I am trying to get the html source of a web site but getting an "Internal Server Error (500)" instead.
Why is it? What can I do?

This is the code:

Public Function GetHtmlDocument(ByVal URL As String) As IHTMLDocument2
            Dim request As HttpWebRequest = WebRequest.Create(URL)
            Dim response As HttpWebResponse = request.GetResponse()
            Dim reader As StreamReader = New StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("Windows-1255"))
            Dim doc As New HTMLDocument
            Dim objDoc As IHTMLDocument2 = doc
            Dim param As Object() = {reader.ReadToEnd()}
            objDoc.write(param)
            response.Close()
            reader.Close()
            Return objDoc
        End Function

thanks.

Hey,
I am trying to get the html source of a web site but getting an "Internal Server Error (500)" instead.
Why is it? What can I do?

This is the code:

Public Function GetHtmlDocument(ByVal URL As String) As IHTMLDocument2
            Dim request As HttpWebRequest = WebRequest.Create(URL)
            Dim response As HttpWebResponse = request.GetResponse()
            Dim reader As StreamReader = New StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("Windows-1255"))
            Dim doc As New HTMLDocument
            Dim objDoc As IHTMLDocument2 = doc
            Dim param As Object() = {reader.ReadToEnd()}
            objDoc.write(param)
            response.Close()
            reader.Close()
            Return objDoc
        End Function

thanks.

Hi assafey,

http://www.checkupdown.com/status/E500.html

The link above takes you to a site that explains all about this error.

Cheers

John

This article has been dead for over six months. Start a new discussion instead.