ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý³Ìªñ¥Îvba¤U¸ütwse¤j½L¸ê®Æ®É¡A¹J¨ì¤@¨Çºô§}ªº°ÝÃD

[µo°Ý] ½Ð°Ý³Ìªñ¥Îvba¤U¸ütwse¤j½L¸ê®Æ®É¡A¹J¨ì¤@¨Çºô§}ªº°ÝÃD

¥»©«³Ì«á¥Ñ ashin1981 ©ó 2016-8-19 21:16 ½s¿è

¦U¦ì¤j¤j§A¦n!

¤p§Ì¤§«e¦³¥Îvba  excel web¤è¦¡¤U¸ü¤j½L«ü¼Æ(twseºô¯¸)¨ìexcel®É³£¬O¥¿±`ªº¡A¦ý¬O³Ìªñ¦b¤U¸ü8¤ë¥÷¸ê®Æ®É¦³¤@¨Ç°ÝÃD¡A¦b8¤ë¥÷¥H«eªººô§}³£¥i¥H§¹¾ã¤U¸ü©Ò¦³¤Ñ¼Æªº¸ê®Æ¡A¤£¾å±o¬O¤£¬Otwseªººô¯¸¦³§ïª©¶Ü?

1. http://www.twse.com.tw/ch/trading/exchange/FMTQIK/genpage/Report201608/201608_F3_1_2.php?STK_NO=&myear=2016&mmon=08
2. http://www.twse.com.tw/ch/trading/exchange/FMTQIK/genpage/Report201607/201607_F3_1_2.php?STK_NO=&myear=2016&mmon=07

¤W­±¨â­Óºô§}¡A²Ä1­Ó¬O8¤ë¥÷ªº¡A¥i¬O¥L¥u¯à¥X²{8/1~8/5ªº¸ê®Æ¡A²Ä2­Ó¬O7¤ë¥÷ªº¡A¥L¥i¥H¥X²{7/1~7/30©Ò¦³ªº¸ê®Æ¡A½Ð°Ý¦U¦ì¤j¤j¥i¥H°Ý¬O­þ¸Ì¦³°ÝÃD¶Ü?
©Î¥i¥H¥Î¨ä¥Lµ{¦¡¤U¸ü¨ìexcel¡C

µ{¦¡¦b8¤ë¥H«e³£¥i¥H¥¿±`Åã¥Ü©Ò¦³¤Ñ¼Æªº¸ê®Æ¡A¦p¤U©Ò¥Ü:

Sub ¤U¸ü¤j½L«ü¼ÆWeb()

    Dim WebSht¤j½L As Worksheet
                    

    ¤j½L«ü¼ÆURL = "URL;http://www.twse.com.tw/ch/trading/exchange/FMTQIK/genpage/Report" & y & m & "/" & y & m & "_F3_1_2.php?STK_NO=&myear=" & y & "&mmon=" & m
   
    Application.EnableCancelKey = xlErrorHandler
    Set WebSht¤j½L = Sheets("¤j½L«ü¼Æ")

    WebSht¤j½L.Cells.Clear
   
    With WebSht¤j½L.QueryTables.Add(Connection:= _
         ¤j½L«ü¼ÆURL, Destination:=WebSht¤j½L.[A2])
        .Name = "201507_F3_1_2.php?STK_NO=&myear=2015&mmon=07"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "8"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
        .Delete
    End With
   
101: ErrNo = Err.Number

Set WebSht¤j½L = Nothing

End Sub

§Ú¤]¹J¨ì³o­Ó°ÝÃD,½Ð°Ý¦³­þ¦ì¤j¤j¥i¨Ñ¸Ñµª¶Ü?

TOP

¦^´_ 2# rinkenny
¨º¨â­Óºô§}¤w¸g¥¢®Ä¤F§a¡H§Ú¸Õ¬O³s¤£¨ì¡C
·sªºÀ³¸Ó¬O
http://www.twse.com.tw/ch/trading/indices/MI_5MINS_HIST/MI_5MINS_HIST.php?myear=105&mmon=08
http://www.twse.com.tw/ch/trading/indices/MI_5MINS_HIST/MI_5MINS_HIST.php?myear=105&mmon=07

TOP

§A­nªº¬O³o­Óºô­¶ªººô§}¶Ü?http://www.tse.com.tw/ch/trading/indices/MFI94U/MFI94U.php

TOP

¦^´_ 3# zyzzyva

¤£¦n·N«ä,§Ú¨S¬Ý²M·¡,³sµ²ºô§}¬O
http://www.twse.com.tw/ch/trading/exchange/FMTQIK/FMTQIK.php?myear=105&mmon=08
¦ý§Ú¬O·Q¦s¦¨CSVÀÉ,¤@ª½§ä¤£¨ìCSVªº³sµ²,½Ð°Ý¦³¿ìªkª¾¹D¶Ü?

TOP

¦^´_ 5# rinkenny
http://www.twse.com.tw/ch/trading/exchange/FMTQIK/FMTQIK.php?
post data¡G
download:csv
query_year:2016
query_month:8
­n¥Îpostªº¤è¦¡

TOP

¯à§_¦³Â²³æªº½d¨Ò¡A¨Ï¥ÎPOSTªº¤èªk
§Ú¤]«Ü¦³¿³½ì
·PÁÂ

TOP

¥»©«³Ì«á¥Ñ zyzzyva ©ó 2016-9-15 11:10 ½s¿è

¦^´_jsleee
postªº¸ê®Æ½Ð¨Ì»Ý¨D¦Û¦æ­×§ï¡C
xml_post.rar (14 KB) 7#

TOP

¦^´_ 8# zyzzyva

    ±z¦n¡A´ú¸Õ±z´£¨Ñªºµ{¦¡½X¡A°õ¦æ¨ì¥H¤U³o¤@¦æµ{¦¡½X·|°±±¼
       oStream.SaveToFile ("C:\file.csv")
   
   ¥X²{ªº²§±`½X¬°
   °õ¦æ¶¥¬q¿ù»~ '3004'
   ¼g¤JÀÉ®×¥¢±Ñ
  
   ¥t¤@­Ó°ÝÃD¡A³o¼Ëªº»yªk¾A¥Î©ó ÃÒ¥æ©Ò¦Uºô­¶¶Ü¡H¦pªG§Ú¥u¬O·Q±N¥H¤Uªººô­¶ ¨Ì·Ó§Ú©Ò«ü©wªº "¤ÀÃþ¶µ¥Ø" §ì¨ìExcel¤u§@ªí¤¤¡A§ï¦p¦ó¤U«ü¥O©O¡H
   http://www.twse.com.tw/ch/trading/fund/MI_QFIIS/MI_QFIIS.php
  
   «Ü©êºp³o³¡¤ÀºN¯Á«Ü¤[¡A´N¬O¤£±o¨äªù¦Ó¤J¡A·Ð½Ð©âªÅ¸Ñ´b¡A·P®¦

JS

TOP

¦^´_ 9# jsleee
½ÐÀˬd¤@¤U¸Ó¸ô®|¦b±zªº¹q¸£¬O§_¦s¦b¡A­Y¬O¡A½ÐÀˬd¸Ó¸ô®|¤U¸Ó¦WºÙ¤§Àɮ׬O§_¤w¦s¦b¡C

¦pªG¬O­nª½±µ¤U¸ü¨ìexcel¸Ì¡A«Øij¨Ï¥Îquerytable¡A¥i¥H°Ñ¦Ò¹ü¤Æ¤jªº³o½g
http://blog.bestdaylong.com/2016/08/excel_23.html

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD