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

[µo°Ý] ¤½¶}¸ê°TÆ[´ú¯¸ªº¥N¸¹¦p¦ó³z¹Lµ{¦¡¦Û°Ê¿é¤J?

[µo°Ý] ¤½¶}¸ê°TÆ[´ú¯¸ªº¥N¸¹¦p¦ó³z¹Lµ{¦¡¦Û°Ê¿é¤J?

¤½¶}¸ê°TÆ[´ú¯¸

½Ð°Ý¦U¦ì¤j¤j
³o­Óºô§}ªº¤½¥q¥N½X©Î²ºÙ
¦p¦ó³z¹LIE±±¨îªº¤è¦¡¿é¤J?

¤w¸g§ä¨ì¸Óid="co_id"
¦ý¿é¤Jvalue¥L´N¬O¤£²z§Ú...= =

¦³¤j¤jª¾¹D­n¦p¦ó¥Î¶Ü?
PKKO

ie.Document.GetElementByID("co_id").Value = 2317
³B²z§¹²¦

¤Ï¦Ó§ä¨ì¸Ó¤¸¥ó¥Îe.valueªº¤è¦¡µLªk¿é¤J
PKKO

TOP

¦^´_ 2# PKKO
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim E As Object, T As Date, R As Integer, C As Integer
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Visible = True
  6.         .Navigate "https://mops.twse.com.tw/mops/web/t05st10_ifrs"
  7.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  8.        ' .Document.GETELEMENTBYID("co_id").Value = "2317"
  9.         For Each E In .Document.all.tags("INPUT")
  10.             If E.ID = "co_id" Then E.Value = "2317"
  11.             If E.Value = " ¬d¸ß " Then E.Click: Exit For
  12.         Next
  13.          T = Time
  14.         Do While .Busy Or .readyState <> 4 Or Time < (T + #12:00:02 AM#): DoEvents: Loop
  15.         Set E = .Document.all.tags("TABLE")(15)
  16.         For R = 0 To E.Rows.Length - 1
  17.             For C = 0 To E.Rows(R).Cells.Length - 1
  18.                 ActiveSheet.Cells(R + 1, C + 1) = E.Rows(R).Cells(C).INNERTEXT
  19.             Next
  20.         Next
  21.         .Quit
  22.     End With
  23. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

  1. Sub ¥¨¶°1()
  2. Cells.Clear

  3.     With ActiveSheet.QueryTables.Add(Connection:= _
  4.         "URL;https://mops.twse.com.tw/mops/web/ajax_t05st10_ifrs?encodeURIComponent=1&firstin=1&off=1&queryName=co_id&isnew=true&co_id=1101", Destination:=Range("$A$1"))
  5.         .WebTables = "4"
  6.         .Refresh BackgroundQuery:=False
  7.         .Delete
  8.     End With
  9. End Sub
½Æ»s¥N½X
¦^´_ 1# PKKO

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD