- 帖子
- 66
- 主題
- 16
- 精華
- 0
- 積分
- 99
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- office 2003
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2012-8-12
- 最後登錄
- 2023-10-26
|
網頁抓取資料疑問
本帖最後由 reangame 於 2014-5-14 23:23 編輯
請教各位大大,下方程式碼是以錄製方式出來的,可是該網頁有可以日期查詢,我試著用錄製方式去抓程式碼,可是卻抓不到選完日期後查詢的程式碼,怎麼匯入都是當日資料,請問如何指定日期查詢後匯入Excel?- [a1].Select
- With ActiveSheet.QueryTables.Add(Connection:= _
- "URL;http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU_d.php#", _
- Destination:=Range("A1"))
- .name = "BWIBBU_d"
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = False
- .RefreshOnFileOpen = False
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingAll
- .WebTables = "8"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
複製代碼 順便附上我的半成品檔案 |
-
-
上市股票.rar
(439.9 KB)
|