0

我正在尝试在以下网站上抓取表格:

它给了我"[an error occurred while processing this directive]"

它一直工作到昨天并开始抛出错误。我在代码中尝试过"URLDownloadToFile",但都抛出了同样的错误。"HTTPResponseStream"VB.net

有什么想法吗?我不是在服务器端编程。这是一个简单的网络/屏幕抓取。

添加代码片段 -

    Dim web_address As String
    'web_address = "http://iso-ne.com/sys_ops/op_frcstng/7day_frcst/index.html"
    web_address = "http://iso-ne.com/sys_ops/op_frcstng/csvdocs/seven_day_forecast2012-07-27-10-13.csv"

    'Dim myReq As HttpWebRequest = WebRequest.Create(web_address)
    'Dim myReq_response As Net.HttpWebResponse
    'myReq_response = myReq.GetResponse()
    'Dim sr As IO.StreamReader = New StreamReader(myReq_response.GetResponseStream) 'Imports System.IO
    Dim strng As String
    'strng = sr.ReadToEnd()


    Dim fileDownloadReq As HttpWebRequest
    Dim fileDownloadResponse As HttpWebResponse
    ' fileDownloadReq = Net.HttpWebRequest.Create(web_address)
    'fileDownloadReq.Method = "get"
    ' fileDownloadResponse = fileDownloadReq.GetResponse


    'Get the data from the page
    'Dim stream As StreamReader = New StreamReader(fileDownloadResponse.GetResponseStream())
    'strng = stream.ReadToEnd()
    'fileDownloadResponse.Close()

    Dim genscapeDataFile As Long
    Dim raw_file_path As String
    raw_file_path = "C:\NEPOOL\ISONE_Seven_day_Raw.csv"
    genscapeDataFile = URLDownloadToFile(0, web_address, raw_file_path, 0, 0)
4

1 回答 1

0

这是托管网页中的错误,而不是您的代码中的错误。每当您遇到此类莫名其妙的问题时,如果可能,您应该直接导航到该页面,并验证它是否按预期工作。

如果您确实在 IE 中导航到此页面,您将看到相同的错误消息。

于 2012-07-27T19:52:05.893 回答