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

[µo°Ý] ¦bºô­¶©â¨ú¸ê®Æ®É¹J¨ì¡u¨S¦³¨Ï¥ÎÅv­­¡vªº°ÝÃD

¦^´_ 3# ¤p«L«È

¸Õ¸Õ¬Ý 2003, XP, IE8 ¤U:¨S¦³Åv­­ªº°ÝÃD
  1. Option Explicit
  2. Sub EX_IE«ö¤UEnter()
  3.     Dim http As Object, i As Integer, A As Object, Result As String
  4.     Set http = CreateObject("InternetExplorer.Application")
  5.     With http
  6.         .Navigate "http://www.hkexnews.hk/sdw/search/search_sdw.asp"
  7.         '.Visible = True
  8.         For i = 1 To 100
  9.             Do While .readyState <> 4 Or .Busy:         DoEvents:    Loop
  10.             .document.getelementbyid("ddlShareholdingDay").Value = 30
  11.             .document.getelementbyid("ddlShareholdingMonth").Value = 11
  12.             .document.getelementbyid("ddlShareholdingYear").Value = 2016
  13.             .document.getelementbyid("txtStockCode").Value = Format(Cells(i, 1), "00000")
  14.             .document.getelementbyid("btnSearch").Click
  15.             Do While .readyState <> 4 Or .Busy:
  16.                 DoEvents
  17.                 If .Busy Then
  18.                     .document.Focus
  19.                     DoEvents
  20.                     Application.SendKeys "{ENTER}", True   '**«ö¤UÁä
  21.                 End If
  22.             Loop
  23.             Result = ""
  24.             Do Until InStr(Result, "pnlResult") > 0
  25.                 Result = .document.body.innerhtml
  26.                 If Len(Result) > 0 Then
  27.                     Cells(i, 2) = IIf(InStr(Result, "pnlResult") > 0, "OK", "Not Exist")
  28.                     If InStr(Result, "pnlResult") = 0 Then GoTo Next_StockCode
  29.                 End If
  30.             Loop
  31.             Set A = .document.getelementbyid("pnlResult")
  32.             Do Until InStr(Result, "Remarks:") > 0
  33.                 DoEvents
  34.                 Result = A.innerhtml
  35.             Loop
  36. Next_StockCode:
  37.         Next i
  38.         .Quit
  39.     End With
  40.     MsgBox "OK"
  41. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD