我正在尝试在以下网站上抓取表格:
它给了我"[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)