- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-9-15 05:56 ½s¿è
¦^´_ 8# espionage
§Ú¥u¦³Ie8¨S³o°ÝÃD, Ie8 ¤¤element ªº Length =9
½Ð¦³¤ñIe8·sª©ªº·|û,¬Ý¬Ý°ÝÃD¦bþ¸Ì.- Application.VBE.Windows("°Ï°ìÅܼÆ").Visible = True '½Ð¦A¥[¤W
- Stop 'µ{¦¡°±¤U¨Ó
- '¦p7#ªº¹Ï¥i¥H¬Ý¬Ý§Aªº "°Ï°ìÅܼÆ"µøµ¡ ¤¤ element ªº Length ¬O¦h¤Ö
½Æ»s¥N½X ©Î¬O- Application.Wait #12:00:05 AM# '¦bµ{¦¡¤¤'µ¥Ô5¬í
- Set element = .Document.getelementsbytagname("table") '¨ú±oºô¶¸ê®Æ°Ï¶ô
- Stop 'µ{¦¡°±¤U¨Ó,¬Ý "°Ï°ìÅܼÆ"µøµ¡ ¤¤ element ªº Length ¬O¦h¤Ö
- With Sheets(1)
- .Cells.Clear
-
½Æ»s¥N½X ©Î¬O¥ÎWEB¬d¸ß- Sub Ex() '¶°«O¤áªÑÅv¤À´²ªí_WEB¬d¸ß
- Dim Ar(), a, i As Integer, strDate As String, stkno As String, Qur As String
- With CreateObject("InternetExplorer.Application")
- .Navigate "http://www.tdcc.com.tw/smWeb/QryStock.jsp"
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Set a = .Document.ALL.tags("option") '¸ê®Æ¤é´Áªº¤º®e
- ReDim Ar(a.Length - 1)
- For i = 0 To a.Length - 1
- Ar(i) = a(i).innerHTML
- Next
- .Quit
- End With
- strDate = Ar(0) '¾É¤J·í¤ë¤é´Á
- Do
- strDate = InputBox(Join(Ar, vbTab), "¶°«O¤áªÑÅv¤À´²ªí¬d¸ß ¤§ ¦³®Ä¤é´Á", strDate)
- If strDate = "" Then Exit Sub
-
- Loop Until IsNumeric(Application.Match(strDate, Ar, 0))
- stkno = InputBox("¿é¤JªÑ²¼¥N¸¹", "ªÑ²¼¥N¸¹", 2317) '
- If stkno = "" Then Exit Sub
- Qur = "http://www.tdcc.com.tw/smWeb/QryStock.jsp?SCA_DATE=" & strDate & "&SqlMethod=StockNo&StockNo=" & stkno & "&StockName=&sub=%ACd%B8%DF"
- With ActiveSheet
- If .QueryTables.Count = 0 Then
- .QueryTables.Add "URL;" & Qur, .[A1]
- Else
- .QueryTables(1).Connection = "URL;" & Qur
- End If
- With .QueryTables(1)
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "6,7,8"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
- End With
- End Sub
½Æ»s¥N½X |
|