- ©«¤l
- 44
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 84
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- sp2
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2016-10-12
- ³Ì«áµn¿ý
- 2021-11-10
|
´£¨Ñ¦Û¤v¼gªºÅª¨útableµ{¦¡½X¡A¦ý®M¥Î¨ì§A´£¨Ñªººô¶¡AtableŪ¥X¨Ó¥u¦³1ÓÄæ¦ì¡A¦p¤U¹Ï
"ªÑ²¼
¥N¸¹®É¶¡¦¨¥æ¶R¶i½æ¥Xº¦¶^±i¼Æ¬Q¦¬¶}½L³Ì°ª³Ì§CӪѸê®Æ
2330¥x¿n¹q
¥[¨ì§ë¸ê²Õ¦X
14:30208.5208.0208.5¡¾1.5 30,867210.0206.5208.5206.5¦¨¥æ©ú²Ó
§Þ³N¡@·s»D
°ò¥»¡@Äw½X
ӪѰ·¶E"
¤£ª¾¦³°ª¤â¦³¤èªk¸Ñ¨M¶Ü¡H- Sub main()
- Dim URL$, VV As Boolean, AB() As String
- URL = "https://tw.stock.yahoo.com/q/q?s=2330"
- AB = GetWebTb1(URL, 6, 1, 1, VV)
- If VV = True Then ActiveSheet.Range("A1") = AB
- End Sub
- Private Function GetWebTb1(sURL00$, nTT00%, nRR00%, nCC00%, bRd00 As Boolean)
- '===sURL00 ¬°Â^¨úºô§}
- '===nTT00 ¬°Åª¨ú²Ä´XÓTable(±q1¶}©l)
- '===nRR00 ¸ÓTable¥Ñ²Ä´X¦C¶}©lŪ¨ú(±q1¶}©l)
- '===nCC00 ¸ÓTable¥Ñ²Ä´XÄæ¶}©lŪ¨ú(±q1¶}©l)
- '===bRd00 ¸Ó¸ê®Æ¬O§_¿é¥X
- Dim nR00%, nC00%, sTemp() As String, oXml As Object, oDoc As Object, oE As Object, tt As Date
- Set oXml = CreateObject("MSXML2.XMLHTTP.6.0")
- Set oDoc = CreateObject("HTMLFile")
- bRd00 = True
- rSend:
- tt = Now() + TimeValue("0:00:20")
- With oXml
- .Open "Get", sURL00, True
- .setRequestHeader "Content-type", "application/x-www-form-urlencoded"
- .send
- On Error Resume Next
- Do While .ReadyState <> 4 Or .Status <> 200
- DoEvents
- If Now > tt Then GoTo rSend
- Loop
- On Error GoTo 0
- oDoc.write .responseText
- End With
- If oDoc.all.tags("Table")(nTT00 - 1) Is Nothing Then bRd00 = False: GoTo Err1
- Set oE = oDoc.all.tags("Table")(nTT00 - 1)
- With oE
- ReDim sTemp(.Rows.Length - nRR00, .Rows(nRR00 - 1).Cells.Length - nCC00)
- For nR00 = 0 To .Rows.Length - nRR00
- For nC00 = 0 To .Rows(nR00 + nRR00 - 1).Cells.Length - nCC00
- sTemp(nR00, nC00) = .Rows(nR00 + nRR00 - 1).Cells(nC00 + nCC00 - 1).innerText
- Next nC00
- Next nR00
- End With
- Err1:
- GetWebTb1 = sTemp
- oXml.abort
- oDoc.Close
- Set oXml = Nothing
- Set oDoc = Nothing
- Set oE = Nothing
- End Function
½Æ»s¥N½X |
|