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

¤WÂd ­ÓªÑ¤é¦¨¥æ¸ê°T §ì¨ú°ÝÃD

¤WÂd ­ÓªÑ¤é¦¨¥æ¸ê°T §ì¨ú°ÝÃD

Hi ¦U¦ì¤j¤j¤¤¬î§Ö¼Ö
³Ìªñ§Ú§Q¥Î°²¤é·Q§ì¨ú ¤WÂd ­ÓªÑ¤é¦¨¥æ¸ê°T¡A³¡¤Àµ{¦¡½X¦p¤U¡A°õ¦æ¤§«á¡A¦³®É­Ô·|°±¦b¹Ï­±¬õ®Øªº¦a¤è¡AÅã¥ÜµL¸ê®Æ¡A¦ý¦³ªº®É­Ô¤S¥i¥H¶]¥X¦¨¥æ°T®§
¦Ó³o­Ó¦a¤èªºµ{¦¡½X¡A§Ú§ä¤£¨ì·j´Mªº«ö¶s¡A©Ò¥Hcopy GKEBB¤j¤j¤§«e¦³¤@¬qªº»yªk    A.Focus   Application.SendKeys "~"
·Q½Ð°Ý¦U¦ì¥ý¶i¡A³o¤@¬q§ÚÀ³¸Ó«ç»ò§ï¶i·|¤ñ¸û¦n?



'------------------------------------------- ¡i¤WÂd¤½¥q¡j------------------------------------------------------
'------------------------- ´M§ä²M³æ¤¤¦³¦h¤Ö¤é´Á(¤ë) »Ý­n®i¦¬´M
Set monthrange = Sheets("²M³æ").Range("D65536").End(xlUp) 'ªí¥Ü´M§ä A Ä檺 stock ªº³Ì«á¤@¦C
For searchmonthrange = 2 To monthrange.Row 'Stock ªº°õ¦æ½d³ò¡A±q²Ä 2 ¦æ¶}©l°õ¦æ¡A¨ì³Ì«á¤@¦æ
myyearwest = Sheets("²M³æ").Cells(searchmonthrange, 3) 'ªÑ»ù¦è¤¸¦~
myyeareast = Sheets("²M³æ").Cells(searchmonthrange, 3) - 1911 'ªÑ»ù¥Á°ê¦~
mymonth = Sheets("²M³æ").Cells(searchmonthrange, 4) 'ªÑ»ù¤ë
yearmonth = myyeareast & "/" & mymonth
'------------------------- ¥´¶}ªÑ²¼ºô­¶
With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô­¶
  .Visible = True
  .Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
   Do While .Busy Or .readyState <> 4: DoEvents: Loop
With .document
'--------------------¿é¤J­n¬d¸ßªº¤é´Á
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.Name = "input_date" Then A.Value = yearmonth
   Next

  '--------------------¿é¤J­n¬d¸ßªºªÑ²¼¥N½X
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.Name = "input_stock_code" Then A.Value = stockcode
   Next

  '--------------------¿é¤J­n¬d¸ßªºªÑ²¼¥N½X
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.ID = "input_stock_code" Then
   A.Focus
   Application.SendKeys "~"
   End If
   Next

End With
Application.Wait Now + #12:00:05 AM# 'µ¥«Ýºô­¶¤U¸ü¸ê®Æ

¦^´_ 1# espionage
¸Õ¸Õ¬Ý
  1. With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô­¶
  2.         .Visible = True
  3.         .Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
  4.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  5.         With .document
  6.             .getElementsByTAGName("INPUT")("input_stock_code").Value = stockcode
  7.             '--------------------¿é¤J­n¬d¸ßªº¤é´Á
  8.             With .getElementsByTAGName("INPUT")("input_date")
  9.                 .Value = yearmonth
  10.                 '*********************
  11.                 .fireEvent ("onchange") 'ie8¥i¥Î
  12.                 '·sª©ie ½Ð°Ñ¦Ò http://forum.twbts.com/thread-14308-1-1.html
  13.                 '**********************
  14.             End With
  15.         End With
  16.     End With
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

Hi GBKEE ¤j¤j
ÁÂÁ§A¡A§Ú¥Ø«e¦bIE8ªººô­¶¥i¥H¾Þ§@¡A¤£¹L§Ú·Q½Ð±Ð¤@­Ó°ÝÃD¡A¬°¤°»ò¨Ï¥ÎfireEvent ("onchange")¤§«á¡A³Ì«á¤@¬qVBA¡A§Ú¥Î'Do While .Busy Or .readyState <> 4: DoEvents: Loop¡A³o­Ó»yªk¡A¦³®É­Ôºô­¶·|µLÅã¥Ü¸ê®Æ¡A¦Ó­n§ï¥ÎApplication.Wait Now + #12:00:03 AM#¡A¤~¤ñ¸ûí©O¡A¨C¦¸³£¦³¸ê®Æ? ¬O¤£¬O­nÅýºô­¶µ¥«Ý

=============¥H¤U¬°VBA===================
'------------------------- ¥´¶}ªÑ²¼ºô­¶
With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô­¶
  .Visible = True
  .Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
   Do While .Busy Or .readyState <> 4: DoEvents: Loop

With .document

  '--------------------¿é¤J­n¬d¸ßªºªÑ²¼¥N½X
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.Name = "input_stock_code" Then A.Value = stockcode
   Next

  '--------------------¿é¤J­n¬d¸ßªº¤é´Á
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.Name = "input_date" Then
   A.Value = yearmonth
   A.fireEvent ("onchange")
   End If
   Next

End With
Application.Wait Now + #12:00:03 AM# 'µ¥«Ýºô­¶¤U¸ü¸ê®Æ
'Do While .Busy Or .readyState <> 4: DoEvents: Loop

TOP

¦^´_ 3# espionage
¤£¿ù¬O­nµ¥«Ýºô­¶ªº¸ê®Æ¤U¸ü§¹²¦
  1. Option Explicit
  2. Sub Ex()
  3.     Dim a As Object, stockcode
  4.     With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô­¶
  5.         .Visible = True
  6.         stockcode = 4111
  7.         .Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
  8.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  9.         With .Document
  10.             .getElementsByTAGName("INPUT")("input_stock_code").Value = stockcode
  11.             '--------------------¿é¤J­n¬d¸ßªº¤é´Á
  12.             With .getElementsByTAGName("INPUT")("input_date")
  13.                 .Value = "104/06" ' yearmonth
  14.                 '*********************
  15.                 .fireEvent ("onchange") 'ie8¥i¥Î
  16.                 '·sª©ie ½Ð°Ñ¦Ò http://forum.twbts.com/thread-14308-1-1.html
  17.                 '**********************
  18.             End With
  19.             With .getElementByID("stk_no")
  20.                 Do
  21.                     If .INNERTEXT = "½Ð¿é¤JªÑ²¼¥N½X¤Î¸ê®Æ¦~¤ë" Then
  22.                         MsgBox "½Ð¿é¤JªÑ²¼¥N½X¤Î¸ê®Æ¦~¤ë"
  23.                         GoTo ER
  24.                     End If
  25.                 Loop Until InStr(.INNERTEXT, stockcode)
  26.             End With
  27.             Set a = .getElementsByTAGName("table")
  28.             MsgBox .getElementByID("stk_no").INNERTEXT & vbLf & a(0).outertext
  29.         End With
  30. ER:
  31.         .Quit
  32.     End With
  33. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD