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

[µo°Ý] ¬d§äºô¯¸¸ê®Æ

¦^´_ 14# GBKEE

³o±i¹Ï­È¤­Áû¬P°Õ¡I

§ï¤Ñ§Ú¦A¨Ó¸Õ¸Õ¤é³øªí§ïª©¥D¬Ý¬Ý

½Ð°Ýª©¥D§ä¸ê®Æ¤]¬O¥Î³oºØ¤è¦¡©O¡HÁÙ¬O¦³§Oªº§ó¦nªº¤è¦¡

vba¤ºÁ䪺¸ê®Æ¦r«¬¤£¯à©ñ¤j

ÁÂÁÂ

TOP

¦^´_ 13# joey0415


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

TOP

¦^´_ 11# GBKEE

½Ð°Ý¶Wª©¡A­Y§ì¥Î¤W¥«¤é³øªíªººô¯¸¡A¥ªÃä¤]¬O¦p¦¹¡Atable¦b¥kÃä¡A­×§ï¶Wª©ªºµ{¦¡»yªk

Set D = .document.all(5).all(0).contentWindow.frames.document.getElementsByTagName("INPUT")
§ï¦¨5¤~¥i¥H¥Î

¥kÃ䪺table­Y¥Î¤U­±ªº
Set D = .document.all(5).all(1).contentWindow.frames.document.getElementsByTagName("table")
«h¼´¤£¨ì¸ê®Æ©O¡I

¥H¤U¬O¤é³øªíªºµ{¥N½X
  1. Sub ¤é³øªí()
  2.     Dim D  As Object, e As Object, URL As String

  3.     URL = "http://bsr.twse.com.tw/bshtm/"
  4. '    URL = "http://tmsearch.tipo.gov.tw/TIPO_DR/GoodsIPOContent.jsp"
  5.     With CreateObject("InternetExplorer.Application")
  6.         .Navigate URL
  7.         .Visible = True
  8.          Do While .ReadyState <> 4 Or .Busy
  9.             DoEvents
  10.         Loop
  11.          Set D = .document
  12.          Stop
  13.         Set D = .document.all(5).all(0).contentWindow.frames.document.getElementsByTagName("INPUT")
  14.         
  15. '        For Each ss In D
  16. '            MsgBox ss.Value
  17. '        Next
  18. '
  19.         Stop
  20.         D("txtTASKNO").Value = "1101"
  21.         For Each e In D
  22.             If e.Value = "¬d¸ß" Then e.Click: Exit For
  23.         Next
  24.         Do While .ReadyState <> 4 Or .Busy
  25.             DoEvents
  26.         Loop
  27.         Set D = .document.all(5).all(1).contentWindow.frames.document.getElementsByTagName("table")
  28. '        Stop
  29. '        For Each ss In D
  30. '            MsgBox ss.innerHTML
  31. '        Next
  32.         
  33.         Stop
  34.         Ep D(0).outerHTML
  35.         .Quit
  36.     End With
  37. End Sub
½Æ»s¥N½X
====================================
­è­è¸Õ¤F­ìª©¥D´£¥Xªººô­¶¤]¬O¤£ª¾¹D¶Wª©»¡ªº¬O­þ¤@­Ó©O¡H

¦p¹Ï


TOP

¦^´_ 11# GBKEE

ÁÂÁ¶Wª©¡A¬ã¨sºô¸ô§ì¨ú¦³¤@¬q®É¶¡¤F¡A³o­Óºô¯¸§Ú¯uªº§ì¤£¨ì¡A©Ò¥H¬Ý¨ì¶Wª©ªº¤~ª¾¹D¦³³o»ò¦^¨Æ

¦p¤U¹Ï¡A¤»¬O³o«ü­Ó¶Ü¡H


§Ú¥u¬Ý¨ìºô­¶¤¤¦³³o¨Ç¤¸¯À§r¡I


¹ï©ó.document.all(6).all(0).

ÁÙ¯u¦³¨Ç¼Ò½k

§Æ±æ¶Wª©¯à¦h«üÂI

ÁÂÁÂ

¦pªG§ä¨ìÃþ¦üªººô­¶¡A¦A½Ð¶Wª©¨Ó¬Ý¬Ý

TOP

¦^´_ 8# ciboybj
§ä¤F¤@¤U2010ª© ¸Õ¸Õ¬Ý¥i§ï¦¨¦p¤U
  1. ' Set D = .document.LastChild.LastChild.all(1).contentWindow.frames.document.getElementsByTagName("table")
  2.         Set D = .document.all(6).all(1).contentWindow.frames.document.getElementsByTagName("table")
½Æ»s¥N½X
¦^´_ 10# joey0415
Set D = .document.all(6).all(0).contentWindow.frames.document.getElementsByTagName("INPUT")
¸ÑÄÀ¦p¤U
.document->HTMLªº[¤å¥óª«¥ó]
.All->documentªºelement [¤¸¯À¶°¦X]
all(6):±Æ¦æ²Ä6¦ì(¤U­­¯Á¤Þ­È±q0 ¶}©l)ªº[¤¸¯À];.all(0)±Æ¦æ²Ä0ªº[¤¸¯À];  
contentWindowÄݩʬO«ü«ü©wªºframe©ÎªÌiframe©Ò¦bªºwindowª«¥ó
getElementsByTagName("INPUT")->¤¸¯À¤¤ªºTagName¬°"INPUT"ªº¶°¦Xª«¥ó
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ joey0415 ©ó 2014-8-6 21:15 ½s¿è
¦^´_  ciboybj
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2014-8-5 06:27



¼gªº¯u¦n¡I½Ð°Ý¶Wª©

Set D = .document.all(6).all(0).contentWindow.frames.document.getElementsByTagName("INPUT")

³o¥y¸Üªº·N«ä¬O¦³¤»­ÓINPUT¤¤ªº²Ä¤@­Ó¤lµøµ¡±N¥¦³]¬°ª«¥ó¶Ü¡H

¦pªG¬Oªº¸Ü¡A¨º¤U­±³o¥y
Set D = .document.LastChild.LastChild.all(1).contentWindow.frames.document.getElementsByTagName("table")
±N¥kÃ䪺TABLEªº³]¬°ª«¥ó¶Ü¡H

¥ªÃ䪺¥s.all(6).all(0).contentWindow.frames

¥kÃ䪺¥s.LastChild.LastChild.all(1).contentWindow.frames

¬°¤°»ò¥kÃ䪺¤£¥sSet XXX = .document.all(1).all(0).contentWindow.frames.document.getElementsByTagName("table")

¦Ó¥B»¡¤W­±ªº¤£¬Oª«¥ó©O¡H¬O¨S¦³ÁÙ¬O¼g¿ù©O¡H

½Ðª©¥D¸Ñ»¡¤@¤U¦n¶Ü¡HÁÙ¬O¦³­þ¤@­Óºô­¶¥i¥H°Ñ¦Ò¡IÁÂÁÂ

TOP

¦^´_ 8# ciboybj
ª«¥ó¤£¤ä´©¦¹ÄݩʩΤèªk (¿ù»~ 438)
¤£¦n·N«ä§Ú¥u¦³2003ª©.µLªk´À§A­×¥¿

½Ð­×§ï6#ªºµ{¦¡½X
   
  1. Dim IE As Object
  2.     Set IE = CreateObject("InternetExplorer.Application")
  3.     With IE
  4.     'With CreateObject("InternetExplorer.Application")
½Æ»s¥N½X

¦³¿ù»~®É ½Ð¨ì¦p¹Ï IEª«¥ó§ä§ä "table" ¦b­þ¸Ì


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

TOP

GBKEE ±z¦n
§Ú¦bwin 7 excel 2010 ¤U°õ¦æ®É
¥X²{°õ¦æ¶¥¬q¿ù»~438
°»¿ù«ü¦V¤U¦Cµ{¦¡½X
Set D = .document.LastChild.LastChild.all(1).contentWindow.frames.document.getElementsByTagName("table")
·Q½Ð°Ý±z³o­n«ç»ò¸Ñ¨M
ps §Ú¥t¥~¦bwin xp excel2003¤¤´ú¸Õ¦¨¥\

¦A½Ð±zÀ°¦£
ÁÂÁ±z

TOP

¦^´_ 5# ciboybj
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim D  As Object, e As Object, URL As String
  4.     '¤u·~¥Î»Ã¯À
  5.     '¤u·~¥Î¤û¥¤µo»Ã¾¯
  6.     '²G´¹
  7.     '¨¾»G¾¯
  8.     '¤u·~¥Î°£¯ä¾¯
  9.     '¤u·~¥Î°®À꾯
  10.     '¤¤©M¾¯
  11.     URL = "http://tmsearch.tipo.gov.tw/TIPO_DR/GoodsIPOContent.jsp"
  12.     With CreateObject("InternetExplorer.Application")
  13.         .Navigate URL
  14.         .Visible = True
  15.          Do While .ReadyState <> 4 Or .Busy
  16.             DoEvents
  17.         Loop
  18.         Set D = .document.all(6).all(0).contentWindow.frames.document.getElementsByTagName("INPUT")
  19.         D("txtGoodsName").Value = "¤¤©M¾¯"
  20.         For Each e In D
  21.             If e.Value = "¬d¸ß" Then e.Click: Exit For
  22.         Next
  23.         Do While .ReadyState <> 4 Or .Busy
  24.             DoEvents
  25.         Loop
  26.         Set D = .document.LastChild.LastChild.all(1).contentWindow.frames.document.getElementsByTagName("table")
  27.         Ep D(0).outerHTML
  28.         .Quit
  29.     End With
  30. End Sub
  31. Private Sub Ep(S As String)
  32.     With CreateObject("InternetExplorer.Application")
  33.         .Navigate "about:Tabs"
  34.         .Visible = True
  35.        .document.body.innerhtml = S
  36.         .ExecWB 17, 2       '  Select All
  37.         .ExecWB 12, 2       '  Copy selection
  38.         With ActiveSheet
  39.             .Cells.Clear
  40.             .Range("A1").Select
  41.             .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
  42.         End With
  43.         .Quit
  44.     End With
  45. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦U¦ì¦n
§Ú§Q¥Î¤U¦Cµ{¦¡ »ª¦ü¥i±N­Èsend ¨ìºô¯¸¤W,¦ý¬O§Ú¤£ª¾¹D¸Ó¦p¦ó§âºô¯¸ªº¸ê®Æ§ì¦^¨Ó
¤£ª¾¹D¬O§_¦³¤H¯àÀ°§Ú¬Ý¬Ý
  1. Sub jdj()
  2. Dim xmlhttp As Object
  3. Set xmlhttp = CreateObject("msxml2.xmlhttp.3.0")
  4. xmlhttp.Open "post", " http://tmsearch.tipo.gov.tw/TIPO_DR/servlet/InitGoodsIPOResult", False
  5. xmlhttp.send " txtGoodsName=%A8F%A9%D4&txtGoodsID=&hdnGoodsNameLabel=%B0%D3%AB%7E%28%AAA%B0%C8%29%A6W%BA%D9&hdnGoodsIDLabel=%B0%D3%AB%7E%28%AAA%B0%C8%29%B2%D5%B8s%A5N%BDX"
  6. If xmlhttp.readystate = 4 Then
  7. MsgBox "done"
  8. end if
  9. end sub
½Æ»s¥N½X
ÁÂÁÂ

TOP

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