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

[µo°Ý] VBA §ì¨úºô¸ôªí®æ

[µo°Ý] VBA §ì¨úºô¸ôªí®æ

¦U¦ìµ{¦¡°ª¤â¦n¡A¤p§Ì·Q°µµ{¦¡§ì¨ú¹³¹d¦ëºô³oÃþªººô¯¸¸ê®Æ
http://www.cnyes.com/twstock/ps_historyprice/1101.htm

¤w¯à°µ¨ìÁä¤J°_©l¤é´Á¤Î¬d¸ß¡A¦ý§ì¨ú¸ê®Æªºµ{¦¡¼g¤£¥X¨Ó¡C
ª¦¹L¨ä¥L¤å¡A³£¬OTABLE¦³id¡A¦ý³oºØªº¤£ª¾±q¦ó¤U¤â¡A
½Ð¨D¨ó§U¡C
  1. Sub Website()


  2.     Dim doc As Object
  3.     Set IE = CreateObject("internetexplorer.application")
  4.      With IE
  5.     IE.Visible = True

  6. navigate:
  7.     IE.navigate "http://www.cnyes.com/twstock/ps_historyprice/1101.htm"
  8.                 'http://www.cnyes.com/twstock/ps_historyprice/1101.htm'

  9.     Do While IE.ReadyState <> 4: DoEvents: Loop

  10.     Set doc = CreateObject("htmlfile")
  11.     Set doc = IE.document

  12.     If doc Is Nothing Then GoTo navigate

  13.     Set txtDtBegin = doc.getelementbyid("ctl00_ContentPlaceHolder1_startText")  '¶}©l¤é´Á'
  14.         txtDtBegin.Value = "2015/11/23"
  15.     Set txtDtEnd = doc.getelementbyid("ctl00_ContentPlaceHolder1_endText")      'µ²§ô¤é´Á'
  16.         txtDtEnd.Value = "2015/11/25"
  17.    
  18.     Set element = doc.getelementbyid("ctl00_ContentPlaceHolder1_submitBut")     'ÂIÀ»«ö¶s'
  19.         element.Click
  20.          
  21.          
  22.     Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  23.     End With
  24.   
  25. End Sub
½Æ»s¥N½X

¦^´_ 1# 52028

°Ñ¦Ò³o¸Ì
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD