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

ÃÒ¥æ©Ò¥þ³¡¤W¥«ªÑ²¼¥æ©ö©ú²Ó¤U¸ü

·q§i¦U¦ì ·|­û
§Æ±æ¦U¦ì¦b¦^¤å®É ¦r¥yªº­×¹¢¬O¥²¶·ªº,­n¦Ò¼{¨ì¹ï¤è¦³¤£µÎªAªº·P¨ü,½Ð¤£­n»s³y¥X¤¬¬Û§ðÀ»ªº ...
GBKEE µoªí©ó 2012-8-5 09:30



7598¬í¬°¥¼Àu¤Æ«eªº¼Æ¾Ú,¶}±Òµøµ¡ªº°õ¦æ°j°é¬O¤£¶}µøµ¡°õ¦æ°j°éªº3.5­¿,ª©¥D¸Ó¤£·|¤]¦b¤å¦r¤W¨Sª`·N¬Ý¨ì§a?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-5 09:54 ½s¿è

¦^´_ 42# white5168
§A³o ¥¼Àu¤Æ »P§Ú 7# ¥¼§ó·s«eªºµ{¦¡¤@¼Ë ©|¥¼´ú¸Õ½T©w¨S°ÝÃD´N«æµÛ±À¥X ¦³ÂIÃþ¦ü
´Á«Ý §AÀu¤Æ«á VBA    ·| [ ±Ð¾Ç¬Ûªø ] ªº
·Q½Ð±Ð python ¤]¬O¥¼Àu¤Æ ¶Ü?

TOP

¦^´_ 41# GBKEE
  1. '¨ú±o­¶¼Æ ; Á׶}¥u¬° [­¶¼Æ] ¨ú±o¦Ó«÷©R¨ê¸Óºô­¶;³y¦¨¶ëÀt http://bsr.twse.com.tw/bshtm/bsMenu.aspx?
  2.     strURL = "http://bsr.twse.com.tw/bshtm/bsMenu.aspx?" & _
  3.     "__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKMTczNDk4NzY0Mg9kFgICAQ9kFgwCBQ8WAh4JaW5uZXJodG1sBQoyMDEyLzA4LzAxZAIGDxYCHwAFCDIwMTIwODAxZAIIDw8WBh4JRm9udF9Cb2xkZx4EXyFTQgKEEB4JRm9yZUNvbG9yCj1kZAIKD2QWAgIBDw9kFgIeB09uQ2xpY2sFHGphdmFzY3JpcHQ6YnV0Q2xlYXJfQ2xpY2soKTtkAgwPDxYGHwFoHwIChBAfAwpHZGQCDg8PFgIeB1Zpc2libGVoZGRktxLZGMAybpsQ2UGpZGNtbwAAAAA%3D&__EVENTVALIDATION=%2FwEWCALzjPG5CALjpuXcAwKN4Ij0CwLB5ZfoCQLjk6TKBwKY8en5CwLdkpmPAQL6n7vzC9kuc7umJfLwqKqibgdx3poAAAAA&HiddenField_spDate=&HiddenField_page=PAGE_BS&txtTASKNO=" & fileIdx & "&hidTASKNO=&btnOK=%E6%9F%A5%E8%A9%A2"
  4.         With xml
  5.             .Open "GET", strURL, 0
  6.             .send
  7.             Do While xml.readyState <> 4
  8.             Loop
  9.             x = Split(Split(.responseText, "sp_ListCount"">")(1), "</span></b>")(0)
  10.         End With
  11. '±N­¶¼Æ¥áµ¹¤U¸ü¥h³B²z
  12. '¤U¸üxls
  13.     With ActiveSheet.QueryTables.Add(Connection:= _
  14.         "URL;http://bsr.twse.com.tw/bshtm/bsContent.aspx?StartNumber=" & fileIdx & "&FocusIndex=All_" & x _
  15.         , Destination:=Range("A1"))             '©ñ¸m¦ì¸m< ----->¥iÅÜ
  16.         .Name = "¨é°Ó"
  17.         .BackgroundQuery = True                 '¨ê·sªð¦^¬d¸ß(°õ¦æ§ó·s)
  18.         .RefreshStyle = xlOverwriteCells        '= xlOverwriteCells 'Âл\­ìÄæ¦ì  = xlInsertDeleteCells '´¡¤J·s¸ê®Æ,­ì¸ê®Æ¥k²¾
  19.         .RefreshPeriod = 0                      '¦Û°Ê§ó·s®É¶¡ ¥H¤À¬°³æ¦ì 5¥Nªí¨C5¤ÀÄÁ§ó·s¤@¦¸ 0¥Nªí¤£¦Û°Ê§ó·s
  20.         .WebSelectionType = xlSpecifiedTables   '«ü©wÃþ«¬= xlEntirePage ¾ã­¶        = xlSpecifiedTables ªí®æ        = xlAllTables ©Ò¦³ªí®æ
  21.         .WebFormatting = xlWebFormattingNone    '= xlWebFormattingNone ¤£«O¯d³sµ²¤Î¼Ë¦¡    = xlWebFormattingRTF  «O¯d³sµ²¤Î®æ¦¡³]©w
  22.         .WebTables = "5,""table2"""             '«ü©w¨ú±o¤§ªí®æ »P .WebSelectionType = xlSpecifiedTables°t¦X = "1,2," ©Î ="5,""table2""" ©Î = """table1"",""table2"""
  23.         .WebDisableDateRecognition = False      '¤é´ÁŲ§O=False ¸T¥Î        =True ¨Ï¥Î
  24.         .Refresh BackgroundQuery:=False         '¨ê·sªð¦^¬d¸ß(°õ¦æ§ó·s)
  25.     End With
½Æ»s¥N½X
§Ú¬O¯uªº¨ØªAW¤jªº¥\¤O,§¹¥þ¨S¦³§ð°P·N«ä¡C
§Ú«Üµæ,¬Ý¹L§Ú¥ý«eªºµo°Ý´Nª¾¹D§Ú¬Oµæ³¾¤@­Ó¡F®É±`³Ò·Ð¦U¦ìÀ°¦£¸Ñ¨M¡e«Ü·P®¦¡f¡C
¥u¬O[´£¿ô]¨ê­¶­±°ÝÃD¡A¤]¬O¥t¤@­Ó¶ë¨®ªº§xÂZ¡C [³o«j±j¥iºâ (±Ð¾Ç¬Ûªø) ªº¤@³¡¥÷]
¦Ü©ó¼g¡F¦]¬°ÁÙ¦A¤£Â_ Try ©óVBA «Ü­¯¥Íªº¥Í¦r¡C¨S¨ì¥i¥HÄmÁ઺³¡¥÷¡C

²{¦b¥¿¦b«ä¦Òªº°ÝÃD¬O , ¦]¬°³B²zxls¦sÀÉ¡F¤]±¾¸ü¬Û·í¤[¡C©Ò¥H§ï¥Îhtm¤U¦^¨Ó¦A¤@°_³B²z¡C
¬ÛÃö¾Ç²ß«ä¸ô¤]¬O¦bª©¤W¡A¦³¸ñ¥i´`¡C

http://forum.twbts.com/thread-7336-1-1.html
http://forum.twbts.com/viewthrea ... p;extra=&page=2

¼gµ{¦¡¨S¦³µ´¹ïªº½Ö¦n½Ö¤£¦n
¥i¥H¦A¤£¦Pªº«ä¸ô¤¤¡F¾Ç¨ì§ó¦hªº¥i¯à©Ê
³oÂI¯uªº«Ü´Î¡I --->¬Û«H«Ü¦hª©¤j³£¦³³oºØ ªì°J
©Ò¥H¼Ö·N¦b¦¹À°§U¹³§Ú³o¼Ëªºµæ³¾

§Ú¥Ø«eÁÙ¨S¨£¹L¦]¬°¦Û¤v¼gªºÄê
§ðÀ»§Úªº,³£¬O¾A«×µ¹§Ú¨ä¥L§ó¦hªº°Ñ¦Ò
³o¹ï©ó§l¦¬¤£¦Pªº«äºû
´£¨Ñ¤F«Ü¦nªº»²§U
¤£¬O¶Ü?!

¦b¦¹!·V­«Án©ú~~~¤£¦A¦^À³W¤jªºµ{¦¡´ú¸Õµ²ªG©Î´£¥X°ÝÃD
¦]¬°,§Ú¤]©È¨ü¶Ë§r!

~~~¥¿¦b­ú!~~~

TOP

¦^´_  GBKEE §Ú¬O¯uªº¨ØªAW¤jªº¥\¤O,§¹¥þ¨S¦³§ð°P·N«ä¡C
§Ú«Üµæ,¬Ý¹L§Ú¥ý«eªºµo°Ý´Nª¾¹D§Ú¬Oµæ³¾¤@­Ó¡F®É±` ...
HSIEN6001 µoªí©ó 2012-8-5 10:22



§Ú¯º¤F
®³¤@­Ó¥¼³Q¹ê²{ªº¥\¯à¨Óµû½×§O¤H,§¹¤§«á´N»°§Ö¶],³o¼Ë«o»¡¦Û¤v«Ü¨ü¶Ë,¥´¤H³Û±Ï¤H,¦pªG¨C­Ó¤H³£³o¼Ë¨º¯uªº¨S§¹¨S¤F
ÁÙ¦³§A©Ò¶K¥Xªºcode¸ò§ÚªºÀ³¸Ó¬O¤£¦P,§A¸Ó¤£·|¬O®³¦Û¤v¼gªºcode,¶]¥X°ÝÃD¦A¨Ó½èºÃ§O¤H§a

TOP

¥»½g¥DÃD°Q½×¦Ü¤µ¡A¤j®a¿ãÅD°Q½×¡A¤¤¶¡©Î³\¤]¦³¨Ç¤f¦ÞÅG½×
§Æ±æºÉ¶q¥H°w¹ïµ{¦¡§Þ³N°µ°Q½×¡A¤£¥²­nªº¤f¤ô¾Ô½Ð¾A¥i¦Ó¤î
¾ãÅé¹Lµ{¤¤¤w¸g¦³¤F§¹¾ãªºµ²½×¡A·íµM­n¦U¾Ì¥»¨Æ¥hÅé·|
³oÃþ¤U¸ü¤è¦¡¡A¨ä¹ê¹ï©óºôºÞ¤H­û¨Ó»¡¡A¬O«D±`¤£»{¦Pªº
©Ò¥H¤U¸ü¤£§¹¥þ¨Ã«Dµ{¦¡ªº°ÝÃD(¤£½×±z¨Ï¥Î¥ô¦óµ{¦¡¤U¸üµ²ªG¬O¤@¼Ëªº)
´NVBA§Þ³N¨Ó»¡¡A¥»©«¤w¸g§¹¥þ±o¨ìµ²½×¡A¬°ÁקK¦A¦³¤£´r§Öªº¤f¤ô¾Ô
¥»©«±NÃö³¬°Q½×¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD