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

[µo°Ý] ¹Ï§ÎÅçÃÒ(Captcha) ¯}¸Ñ?

[µo°Ý] ¹Ï§ÎÅçÃÒ(Captcha) ¯}¸Ñ?

ÃÒ¥æ©Ò¶}©ñ¤U¸ücsvÀɤF~  http://bsr.twse.com.tw/bshtm/
·Q§ï¼g¤§«eªº¤U¸ü¤è¦¡
¥»¨Ó¬O§Q¥Îweb¬d¸ß¦b¥t¦s¦¨csvÀÉ
¦ý¬O®Ä²v«Ü®t

¦bÃÒ¥æ©Òºô¯¸¤¤
¤U¸ü«e¥²¶·¿é¤J¹Ï§ÎÅçÃÒ
¦Ó¥B¨C¦¸·|¤£¦P
·Qª¾¹D¦³¨S¦³¿ìªk¦bVBA¤W¯}¸Ñ?
¥Ø«eªº·Qªk¦³¤G
¤@¬O¨Ï¥Î¹Ï§Î¿ëÃÑ(OCR)
´Nºô­¶¤Wªº¹Ï¬Ý°_¨ÓÁÙºâ¤u¾ã
¥u¬O³o»ò°µ®Ä²v¥i¯à¤]¤£·|¤Ó¦n(?) ÁÙ¨S¸Õ¹L
²Ä¤G­Ó·Qªk¬O§Q¥Îºô­¶cookie
§Ú²q¿é¤JÅçÃÒ½X¤§«á·|±o¨ì¤@²Õcookie§@¬°Æ_°Í
§Q¥ÎVBA¥Í¦¨/«O¯d¨º²Õcookie»¡¤£©w¥i¥H¤@³Ò¥Ã¶h?
¤£ª¾¹D¦³¨S¦³¸Ñªk ·PÁÂ!!

ÃÒ¥æ©Ò¶}©ñ¤U¸ücsvÀɤF~  http://bsr.twse.com.tw/bshtm/
·Q§ï¼g¤§«eªº¤U¸ü¤è¦¡
¥»¨Ó¬O§Q¥Îweb¬d¸ß¦b¥t¦s ...
lalalada µoªí©ó 2013-5-10 22:22



    1.¦pªG¥ÎOCR ¿ëÃÑ  ·|¦³´X­Ó°ÝÃD²£¥Í
      1-1 §¹¾ã©Ê <­^¤å¡B¼Æ¦r¡B¤å¦r>
      2-2 ¥i¿ëÃÑ«× < ¦p ¹Ï¤º X¡BYÂI¡A©Î ¨ä¥L>

     2.¦pªG¥ÎCookie ¡A¨º ¥i¥H¸ò©p»¡..  °ò¥»¤W ¦¹¤èªk´X¥G¤£¥i¯à...
         ­ì¦]¬°¦ó¡H °£«D¡A©p¦³¸Óºô¯¸©Ò¦³¹Ï§ÎÅçÃÒªº¹Ï¸ê ©Î  ©p¯à¿ëÃÑ ¹Ï§Î¡A§_«h COOKIE ¤£·|¬O©T©wªº
         ¦pªG ¤µ¤ÑAºô¯¸ ªº ¹Ï§ÎÅçÃÒªº¹Ï¸ê¦³100ºØ ¡A °ò¥»¤W ´N¦³¥i¯à¦³ 100ºØCOOKIE ...

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 2# mark15jill

·PÁ¦^ÂÐ!
¨º¦pªG·Q¨Ï¥ÎOCRªº¸Ü
¦bVBA¤º¸Ó«ç»ò¤Þ¥Î©O?

¿ëÃѪº¸Ü¦]¬°­è¦nºô¯¸¥u±Ä¥Î¼Æ¦r
¦Ó¥B©³¦â³æ¯Â¤]¨S¦³¤Ó¦hÅܧγB²z
OCR¿ëÃÑÀ³¸Ó¬O¥i¦æªº
¥Ñ©ó¤Ö±¼¤F¹ï¹Ï§Îªº³B²z
»¡¤£©wÁÙ¬O¯à¤ñ­ì¥»ªº§@ªk§Ö(?)

¨ä¹ê­ì¥»ªº§@ªk°£¤F¶¸ô¤§¥~
³t«×ºCªº¨ä¤¤¤@­Ó­ì¦]¬O¦]¬°¥¦·|¾×¤j¶q³sÄò³s½u­n¨D
¨C¤­¦¸¥²¶·µ¥5¬í¥ª¥k

TOP

¦^´_ 3# lalalada


    ©êºp Ãö©ó³o³¡¥÷¤p§Ì´NµL²`¤J¬ã¨s

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 4# mark15jill

ÁÙ¬O«Ü·PÁ§AÄ@·N¤À¨É:)
³Ìªñ¤ñ¸û¦£
µ¥§Ú§ä¨ì¤èªk¦Apo¤W¨Ó

TOP

¥»©«³Ì«á¥Ñ joey0415 ©ó 2013-9-27 22:29 ½s¿è

¦^´_ 5# lalalada


    ¹Ï§Î³¡¥÷¡Aexcel homeÂŤѤj¦³¡A¤£¹L§ÚÁÙ¤£·|¥Î
http://club.excelhome.net/home.php?mod=space&uid=1666515&do=thread&view=me&from=space

¨C¤é¨é°Ó§Ú¬O¤U¸ücsv

¤W¥«¡G¨C¤é¬ù30¤À(ºô­¶Âàcsv)
¤WÂd¡G¨C¤é5¤À(csv)

Âà¶i¸ê®Æ®w¥t­p

¥H¤W¬°vba

Å¥»¡¥Îpython¥i¥H¦h½u¤U¸ü·|§ó§Ö¡A¤£¹L§Ú¨S¦³¥Î¡I

TOP

¦^´_ 5# lalalada
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub ÃÒ¥æ©Ò_¶R½æ¥æ©ö¤é³øªí()
  3.     Dim Stock_NO As String, Sh As Worksheet, URL As String, WB As Workbook
  4.     Do
  5.       Stock_NO = InputBox("ªÑ²¼¸¹½X")
  6.       If Stock_NO = "" Then Exit Sub
  7.     Loop Until Len(Stock_NO) >= 4
  8.     Set Sh = ActiveWorkbook.Sheets.Add
  9.     Application.DisplayAlerts = False
  10.     On Error GoTo Er
  11.     Sh.Name = Stock_NO
  12.     Application.StatusBar = "¤U¸ü¸ê®Æ¤¤.... "
  13.     Application.ScreenUpdating = False
  14.     URL = "http://bsr.twse.com.tw/bshtm/bsContent.aspx?StartNumber=" & Stock_NO & "&FocusIndex=All_" & ³øªí­¶¼Æ(Stock_NO)
  15.     Set WB = Workbooks.Open(URL)
  16.     With WB.Sheets(1)
  17.         If .UsedRange.Count = 1 Then GoTo xOUT         'ªÑ²¼¨S¦³¸ê®Æ
  18.         .UsedRange.Columns("A:Q").ClearFormats
  19.         .UsedRange.Columns("B:H").Delete Shift:=xlToLeft
  20.         .UsedRange.Columns("B:B").SpecialCells(xlCellTypeBlanks).Offset(, -1).Delete xlShiftUp
  21.         .UsedRange.Columns("B:E").SpecialCells(xlCellTypeBlanks).Delete xlShiftUp
  22.         .UsedRange.Columns("F:J").SpecialCells(xlCellTypeBlanks).Delete xlShiftUp
  23.         .UsedRange.Columns("F:J").Cut .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
  24.         .Rows("1:2").Delete
  25.         With .UsedRange
  26.             .Value = .Value
  27.             .Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:=xlYes
  28.             .Offset(3).Replace "§Ç", "=XXX", xlWhole
  29.             .SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
  30.         End With
  31.         .UsedRange.Copy Sh.[A1]
  32.         Sh.UsedRange.EntireColumn.AutoFit
  33.     End With
  34.     WB.Close False
  35.     Application.ScreenUpdating = True
  36.     Application.StatusBar = False
  37.     Exit Sub
  38. Er:
  39.     Sheets(Stock_NO).Delete
  40.     Resume
  41. xOUT:
  42.     WB.Close False
  43.     Sheets(Stock_NO).Delete
  44.     MsgBox "¨S¦³ªÑ²¼ " & Stock_NO
  45.     Application.StatusBar = False
  46.     Application.ScreenUpdating = True
  47. End Sub
  48. Private Function ³øªí­¶¼Æ(Sstock_N0 As String) As String
  49.     Dim element As Object
  50.     With CreateObject("InternetExplorer.Application")
  51.         .Navigate "http://bsr.twse.com.tw/bshtm/bsMenu.aspx"
  52.          Do While .Busy Or .ReadyState <> 4
  53.             DoEvents
  54.         Loop
  55.         .Document.getElementsByName("txtTASKNO")(0).Value = Sstock_N0
  56.         .Document.getElementsByName("btnOK")(0).Click
  57.          Do While .Busy Or .ReadyState <> 4
  58.             DoEvents
  59.         Loop
  60.        ³øªí­¶¼Æ = .Document.getElementsByName("sp_ListCount")(0).innertext
  61.        .Quit
  62.     End With
  63. End Function
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE


    Ãö©ó¹Ï§ÎÅçÃÒCaptchaªº¤è¦¡,³o¬Ojoey0415´£¨Ñ±o[°Ñ¦Ò]¨Ó·½
¬Ý¤£À´^_^!!          ¦ý¶]ÅçÃÒ½X¬O¥¿½Tªº
  1. Public Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Long
  2. Public Declare Function CloseClipboard Lib "user32" () As Long
  3. Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
  4. Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
  5. Private Declare Function GlobalSize Lib "kernel32" (ByVal hMem As Long) As Long
  6. Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
  7. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  8. '°Å¶Kª©¸ê®Æ®æ¦¡©w¸q
  9. Private Const CF_DIB = 8

  10. Sub ÅçÃÒ½XÃѧO()
  11.     Dim a(1 To 4)
  12.     Dim img       '¡]ÅçÃÒ½X¡^¹Ï¤ù
  13.     Dim CtrlRange '«D¤å¥»ª«¥ó¶°¦X
  14.     Dim bytClipData()  As Byte '©w¸q¦ì¤¸²Õ°}¦C
  15.     Dim arr(0 To 1260)
  16.     Dim ts As Integer
  17.     On Error Resume Next
  18.     Set Regedit_XG = CreateObject("WScript.Shell")              '³Ð«Ø¤@­ÓªÅªºVBS"´ß"
  19.     Jz = Regedit_XG.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1407")                   'Ū¨úµù¥Uªí"¦w¥þ³]¸m-Internet°Ï°ì"¤¤ªº"¤¹³\¹ï°Å¶KªO¶i¦æ½sµ{³X°Ý"³]¸m(3¡×¸T¥Î¡B0¡×±Ò¥Î¡B1¡×´£¥Ü)­ì©l­È
  20.     Regedit_XG.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1407", "0", "REG_DWORD"      '­×§ïµù¥Uªí"¦w¥þ³]¸m-Internet°Ï°ì"¤¤ªº"¤¹³\¹ï°Å¶KªO¶i¦æ½sµ{³X°Ý"³]¸m(3¡×¸T¥Î¡B0¡×±Ò¥Î¡B1¡×´£¥Ü)¡A¨Ï¨t²ÎÀq»{¬°"¤¹³\³X°Ý°Å¶KªO"
  21.     With CreateObject("InternetExplorer.application")           '³Ð«Ø¤@­ÓªÅªºie
  22.         .Visible = True                                         'Åýie¥i¨£
  23.         .Navigate "http://119.145.135.38/fscx/web/loginForm.do" '¾É¯è¨ìhttp://119.145.135.38/fscx/web/loginForm.do
  24.         Do Until .ReadyState = 4               'µ¥«Ýie§¹²¦¸ü¤J
  25.             DoEvents
  26.         Loop
  27.         Set img = .Document.All.tags("img")(0) '«ü©w¡]ÅçÃÒ½X¡^¥Ø¼Ð¹Ï¤ù
  28.         Set CtrlRange = .Document.body.createControlRange()  '³Ð«Ø«D¤å¥»ª«¥ó ControlRange ¶°¦X
  29.         CtrlRange.Add img                      '¦V«D¤å¥»ª«¥ó ControlRange ¶°¦X¤¤²K¥[ img ª«¥ó
  30.         CtrlRange.execCommand "Copy", True     '±q ControlRange ¶°¦X¤¤copy img ª«¥ó¡]¹Ï¤ù¡^¨ì°Å¶KªO
  31.         Dim hMem As Long, lpData As Long
  32.         OpenClipboard 0&                       '¥´¶}Ö߶KªO
  33.         hMem = GetClipboardData(8)             'Àò±oÖ߶KªO¸ê®Æ¡A«ü©w®æ¦¡¬°¡GCF_DIB = 8
  34.         If CBool(hMem) Then
  35.             lpData = GlobalLock(hMem)          'Âê©w°O¾ÐÅ骫¥óhMen
  36.             lClipSize = GlobalSize(hMem)       'Àò±oÖ߶KªO¸ê®Æ¦ì¤¸²Õ¼Æ
  37.             If lpData <> 0 And lClipSize > 0 Then
  38.                 ReDim bytClipData(0 To lClipSize - 1) As Byte      '­«·s©w¸q¦ì¤¸²Õ°}¦C¤j¤p
  39.                 CopyMemory bytClipData(0), ByVal lpData, lClipSize 'Ö߶KªOÂà¤Æ¦¨¦ì¤¸²Õ°}¦C
  40.             End If
  41.             GlobalUnlock hMem                  '¸Ñ°£Âê©w°O¾ÐÅ骫¥óhMen
  42.         End If
  43.         CloseClipboard                         'Ãö³¬Ö߶KªO
  44.         For i = 1 To 1260                      'Âk¤@¤Æ³B²z
  45.             ts = (Val(bytClipData((i - 1) * 3 + 40)) + Val(bytClipData((i - 1) * 3 + 41)) + Val(bytClipData((i - 1) * 3 + 42))) / 3 '40¬O¹Ï¤ù¶}©l¦ì¤¸²Õ
  46.             If ts > 150 Then
  47.                 ts = 0
  48.             Else
  49.                 ts = 1
  50.             End If
  51.             arr(i) = ts
  52.         Next i
  53.         For i = 1 To 4
  54.             a(i) = 0                                                          '0
  55.             If arr(13 * 60 + 8 + (i - 1) * 14) = 1 And arr(14 * 60 + 8 + (i - 1) * 14) = 1 Then a(i) = 1: GoTo 1 '16¦ì¦â¡A©Ò¥H­¼¥H"3"RGB¦U¥e¤@¦ì¤¸²Õ¡A60¬O¼e¡A14¬O¦r¶¡¶Z¡A
  56.             If arr(4 * 60 + 6 + (i - 1) * 14) = 1 Then a(i) = 2: GoTo 1       '2
  57.             If arr(16 * 60 + 11 + (i - 1) * 14) = 0 Then a(i) = 3: GoTo 1     '3
  58.             If arr(7 * 60 + 5 + (i - 1) * 14) = 1 Then a(i) = 4: GoTo 1       '4
  59.             If arr(12 * 60 + 9 + (i - 1) * 14) = 1 Then a(i) = 5: GoTo 1      '5
  60.             If arr(9 * 60 + 8 + (i - 1) * 14) = 1 And arr(11 * 60 + 9 + (i - 1) * 14) = 1 Then a(i) = 6: GoTo 1  '6
  61.             If arr(16 * 60 + 13 + (i - 1) * 14) = 1 Then a(i) = 7: GoTo 1     '7
  62.             If arr(10 * 60 + 8 + (i - 1) * 14) = 1 And arr(11 * 60 + 8 + (i - 1) * 14) = 1 Then a(i) = 8: GoTo 1 '8
  63.             If arr(9 * 60 + 9 + (i - 1) * 14) = 1 Then a(i) = 9               '9
  64. 1:
  65.         Next i
  66.         Cells(1, 1) = a(1) & a(2) & a(3) & a(4)             'ÃѧO«áªºÅçÃÒ½X
  67.         .Document.All.tags("INPUT")(0).Value = "1234567890" '¶ñ¼gµn¿ý¦W
  68.         .Document.All.tags("INPUT")(1).Value = "0987654321" '¶ñ¼g±K  ½X
  69.         .Document.All.tags("INPUT")(2).Value = Cells(1, 1)  '¶ñ¼gÅçÃÒ½X
  70.         .Document.All.tags("img")(1).Click                  'ÂIÀ»"µn¿ý"«ö¶s
  71.         '.Quit                     'Ãö³¬ie
  72.         'MsgBox "OK"
  73.     End With
  74.     Regedit_XG.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1407", Jz, "REG_DWORD"      '«ì´_µù¥Uªí"¦w¥þ³]¸m-Internet°Ï°ì"¤¤ªº"¤¹³\¹ï°Å¶KªO¶i¦æ½sµ{³X°Ý"³]¸m(3¡×¸T¥Î¡B0¡×±Ò¥Î¡B1¡×´£¥Ü)­ì©l­È
  75.     Set Regedit_XG = Nothing      'ÄÀ©ñVBS"´ß"
  76. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# GBKEE


    ¹ï¤£°_!§Ñ¤Fªþ¤WURL
¤U¸üCSV¬ÛÃö¦ì§}:
(1)¤£ª¾¹D¥Îªº¤W?!
http://bsr.twse.com.tw/bshtm/bsMenu.aspx?__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTQzNzI3ODE3MQ9kFgICAQ9kFg4CBQ8WAh4JaW5uZXJodG1sBQoyMDEzLzA5LzI3ZAIGDxYCHwAFCDIwMTMwOTI3ZAIIDw8WBh4JRm9udF9Cb2xkZx4EXyFTQgKEEB4JRm9yZUNvbG9yCj1kZAIKD2QWAgIBDw9kFgIeB09uQ2xpY2sFHGphdmFzY3JpcHQ6YnV0Q2xlYXJfQ2xpY2soKTtkAgwPDxYGHwFoHwIChBAfAwpHZGQCDg8PFgIeB1Zpc2libGVoZGQCEA8PFgYfAWgfAgKEEB8DCkdkZGSiKU%2Fti2BvI3vsAvp%2BUySKAAAAAA%3D%3D&__EVENTVALIDATION=%2FwEWCQKGnJS3DwLjpuXcAwKN4Ij0CwLB5ZfoCQLjk6TKBwKY8en5CwLdkpmPAQL6n7vzCwLAhrvLBeRfGpOZWTxdVZsdlLXS6sgAAAAA&HiddenField_spDate=&HiddenField_page=PAGE_DownloadBS&txtTASKNO=%E8%AB%8B%E8%BC%B8%E5%85%A5%E8%82%A1%E7%A5%A8%E4%BB%A3%E7%A2%BC&hidTASKNO=&Button_DownloadBS=%3C%E4%B8%8B%E8%BC%89+CSV%3E

(2)Download
http://bsr.twse.com.tw/bshtm/bsDownload.aspx?__VIEWSTATE=%2FwEPDwUJNDA4NDA2OTYwZGSrd3Tlksjh9VIjA2KPwnxSAAAAAA%3D%3D&__EVENTVALIDATION=%2FwEWBgLgmuzfAwLPiaeCCQLNkNdZAs%2Bk8%2FwMAp%2BC7OYNAsyPx6EHbi4KW9bFIDAKFtSJoAwOXQAAAAA%3D&HiddenField_Download=&TextBox_Stkno=ªÑ²¼¥N¸¹&TextBox_VerifyCode=ÅçÃÒ½X&Button_Download=%E4%B8%8B%E8%BC%89

TOP

¦^´_ 9# HSIEN6001

¤£ª¾HSIEN6001¤j

¥i¥H§ï¦¨ÅçÃÒ¥xÆWªº¶Ü¡H

§Ú¦Û¤v¸Õ¬O¤£¦¨¥\ªº¡AŪ¥xÆWÅçÃÒ½X³¡¥÷

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD