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

[­ì³Ð] ¶°«O¸ê®Æ(§ïª©«á)

¦^´_ 9# bhsm
  1. Sub test()

  2. stockno = InputBox("½Ð¿é¤JªÑ²¼¥N¸¹")
  3. If stockno = "" Then Exit Sub
  4. Application.ScreenUpdating = False
  5. [A4].CurrentRegion.Clear

  6. t = Timer

  7. Dim myXML As Object
  8. Set myXML = CreateObject("WinHttp.WinHttpRequest.5.1")

  9. Dim myHTML As Object
  10. Set myHTML = CreateObject("HTMLFile")

  11. myLimit = 10 'ªñ´Xµ§¸ê®Æ¼Æ

  12. ReDim myDateArr(1 To 60, 1 To 1)
  13. ReDim myValArr(1 To 25, 1 To myLimit * 5)

  14. With myXML
  15.     .Open "POST", "https://www.tdcc.com.tw/smWeb/QryStockAjax.do", False    '¥ý§ì¨ú¤é´Á
  16.     .setRequestHeader "Content-type", "application/x-www-form-urlencoded;charset=UTF-8"
  17.     .send "REQ_OPR=qrySelScaDates"
  18.    
  19.     k = 1
  20.     For Each myText2 In Split(.responseText, ",")
  21.         myDateArr(k, 1) = Replace(Replace(Replace(myText2, Chr(34), ""), "[", ""), "]", "")
  22.         k = k + 1
  23.     Next
  24.    
  25.     mycount = 1
  26.     For Each myDate In myDateArr
  27. retry:
  28.         .Open "POST", "https://www.tdcc.com.tw/smWeb/QryStockAjax.do", False    '¥N¤J¤é´Á¼´¸ê®Æ
  29.         .setRequestHeader "Content-type", "application/x-www-form-urlencoded"
  30.         .send "scaDates=" & myDate & "&scaDate=" & myDate & "&SqlMethod=StockNo&StockNo=" & stockno & "&StockName=&REQ_OPR=SELECT&clkStockNo=" & stockno & "&clkStockName="
  31.         
  32.         If InStr(1, .responseText, "µL¦¹¸ê®Æ") <> 0 Then GoTo retry
  33.         
  34.         myHTML.body.innerHTML = .responseText
  35.         
  36.         Set mytable = myHTML.getElementsByTagName("table")(7)
  37.         
  38.         i = 1
  39.         
  40.         For Each myRow In mytable.Rows
  41.             
  42.              j = 5 * (myLimit - mycount) + 1
  43.             For Each myCell In myRow.Cells
  44.                 myValArr(i, j) = myCell.innerText
  45.                 j = j + 1
  46.             Next
  47.             i = i + 1
  48.         Next
  49.         Cells(4, j - 5) = myDate
  50.         Debug.Assert Cells(4, j - 4) = ""
  51.         mycount = mycount + 1
  52.         If mycount = myLimit + 1 Then Exit For '­n§ì´Xµ§¸ê®Æ
  53.     Next
  54. [A3] = "ÃÒ¨é¦WºÙ¡G" & Split(Split(.responseText, "ÃÒ¨é¦WºÙ¡G")(1), "<")(0)
  55. [A5].Resize(UBound(myValArr), 5 * myLimit).Value = myValArr

  56. End With

  57. Erase myDateArr
  58. Erase myValArr
  59. Set myXML = Nothing
  60. Set myHTML = Nothing

  61. Debug.Print Format(Timer - t, "0.00’")
  62. Application.ScreenUpdating = True
  63. End Sub
½Æ»s¥N½X
¸Õ¬Ý¬Ý³o­Ó§a~
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¥»©«³Ì«á¥Ñ iamaraymond ©ó 2018-3-28 22:02 ½s¿è

¦^´_ 10# quickfixer

³o­Ó¤å¤§«e§Ú¤]¦³¬Ý¹L¡ASnare¤jªºµ{¦¡·íµM¤ñ§Ú³oºØªù¥~º~±j«Ü¦hXD
¥u¬O§Ú¤ñ¸û²ßºD§â¨C¤@©P³£¦C¥X¨Ó¡A©Ò¥H­Y±z¦³¿³½ìªº¸Ü¥i¥H¬Ý¬Ý§Ú­è­è·s©ñ¤W¥hªº¶K¤å
¦Ü©ó³t«×¦b¨ä¥L±ø¥ó®t¤£¦hªº±¡ªp¤U¡A¥D­n¬O¨ú¨M©óµo¤F¦h¤ÖRequest¡A¦b¥Lªºcode¤¤¥u§ì¤F2­Ó§«ôªº¸ê®Æ¡A¦ý§Ú§ì¤F10­Ó§«ôªº¡A©Ò¥H³t«×·|¤ñ¸ûºC
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 7# cji3cj6xu6


°ÝÃD1:§Ú­è­è·s¤W¶Ç¤FCode¡A¥i¥H°Ñ¦Ò¬Ý¬Ý
°ÝÃD2:¦]¬°§Ú¨S¹J¨ì³o­Óª¬ªp¡A©Ò¥H¤£½T©w

¦Ü©ó­n¸õµÛ§ì¨ä¹ê¤èªk«Ü¦h¡A¨Ò¦p¥Îif³]©w­p¼Æ¾¹0©M1¡A·íµ¥©ó1®É¤~§ì
©Î¬O§PÂ_L¬O¤£¬O°¸¼Æ¤§Ãþªº
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2018-3-28 22:11 ½s¿è

¦^´_ 12# iamaraymond


   ¥L¬Ý°_¨Ó¹³¬OªÑ²¼ªù¥~º~ :lol
³t«×ªº¸Ü¡A¥L244¼Ó¦³ª±¹L¤@­Ó8¶}excel , 20¦h¬í´N§ìª±3¤d¦hµ§¶°«O¸ê®Æ XD
¥i±¤ºô¯¸§ïª©«á¡A¥L¨S§ó·s¡A¨º­Ó½d¨Ò¨S¿ìªkª±¤F

§Aªºµ{¦¡¦h¥[¤Won error goto©Î¬Oon error resume ·|¤ñ¸û¦n
cji3cj6xu6  ªº°ÝÃD2 ¡A§Ú¤]¦³¹J¨ì

³Ìªñºô¯¸·|¬ðµM¥X²{¤°»ò¦w¥þ©Ê³s½u¿ù»~ªº
¦b³o¤@¦æ´N·|¥X¿ù
.send "REQ_OPR=qrySelScaDates"

TOP

¥»©«³Ì«á¥Ñ iamaraymond ©ó 2018-3-28 22:21 ½s¿è

¦^´_ 14# quickfixer

§A­Ìªº¿ù»~¬O¤£¬O"¦w¥þ³q¹D¤ä´©µo¥Í¿ù»~ "?
¦pªG¬Oªº¸Ü¡A§Ú¤§«e¦n¹³¦³¬Ý¨ì¦³­Ó¸Ñ¨M¤èªk¬O
¥´¶}µù¥Uªí(·j´Mregedit)
   

µM«á¨Ì¾Ú¹q¸£±¡ªp
(for Windows 7 64 bits)
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp]
"DefaultSecureProtocols"=dword:00000a00

(for Windows 7 32 bits)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp]
"DefaultSecureProtocols"=dword:00000a00

°Ñ¦Ò¬Ý¬Ý

¼W¥[³t«×ÁÙ¦³­Ó¤èªk¬O¥Î°}¦C¡A³t«×¯uªº®t«Ü¦h¡A­ì¥»­n¶]3,4¬íªºªF¦è³£¥u­n0.X¬í´N¦n¤FXD
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 2# joey0415

ÁÂÁ§A¤À¨É³o¡A2015¦~´N¦³ªººô¯¸,¤µ¤Ñ¤~ª¾¹D­ì¨Ó¦³¾ã²z¦nªº¸ê®Æ¥i¥H¤U¸ü
    https://data.gov.tw/dataset/11452

TOP

¦^´_ 15# iamaraymond


¸Õ¹L¤F¡A¤@¶}©l§ä¤£¨ìDefaultSecureProtocols¡A¦w¸Ë¤F­×¥¿µ{¦¡«á§ä¨ì¥¦¡A¦ý¨Ì¦³¦P¼Ëªº°ÝÃD¡A¤£¥ÎºÞ¥¦¤F¡C

ÁÂÁÂ~~

TOP

¦^´_ 11# iamaraymond
ÁÂÁÂiamaraymond¤j
¦~ÄÖ¤£¤p,¦ý§Ú«Ü·Q¾Ç

TOP

½Ð°Ý­Y»Ý­n§ó§ï¬°¶°«O¤j©ó400±i¥H¤WÁͶդñ¸û¸Ó¦p¦óÅܧó

TOP

¦^´_ 2# joey0415

¤p§Ì¤£¤~ ·Q½Ð°Ý §Ú±NÀɮקì¤U¨Ó¤F
¦ý¤p§Ì¤£ª¾¦p¦ó ·J¾ã
¤p§Ì·Q·J¾ã
1000±i¥H¤Wªº¤ñ¨Ò
200±i¥H¤Uªº¤ñ¨Ò

·Q½Ð¤j¤jÀ°¦£  ±Ð±Ð¤p§Ì
«D±`·PÁ±zªºÀ°¦£
ÁÂÁÂ
¾Ç²ß ¾Ç²ß ¤@ª½¾Ç²ß

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD