- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
[µo°Ý] ¦p¦ó§ó§ïºô¶¤¤ªºOPTION§@¨ú±o¸ê®Æ©MÂà´«ÁcÅ餤¤å°ÝÃD
¥»©«³Ì«á¥Ñ ¤p«L«È ©ó 2015-7-10 10:33 ½s¿è
¤j®a¦n¡A§Ú¥´ºâ¨ìSINA CNªººô¯¸¨ú±o°]°È¸ê®Æ¡G
http://stock.finance.sina.com.cn/hkstock/finance/00001.html
·í¤¤ªº¸ê®Æ¤w¸g±Æ¦n¡Aºâ¬O«Ü¦n¨ú±o¡C¦ý³oºô¯¸ªº¡u³øªíÃþ«¬¡v¹w³]¬O¡u¥þ³¡¡v¡A©Ò¥H·|¦P®ÉÅã¥Ü¦~³ø©M¤¤³ø¸ê®Æ¡A¦]¬°Äæ¦ì©Ò(8Ó)¡A¥u·|Åã¥Üªñ¥|¦~ªº¸ê®Æ¡C¦pªG§â¡u³øªíÃþ«¬¡v§ï¦¨¡u¦~³ø¡v¡A§Ú«K¥i¥H¨ú±oªñ¤K¦~ªº¸ê®Æ¡C¥Ñ©ñn§ó§ïºô¶ªºSELECT OPTION¡A©Ò¥H¤£¯à¥ÎQueryTablesªº¤èªk¡C
§Ú¹Á¸Õ¥Î¥H¤UCODING¡A¬O¥i¥H§ï¨ì¡u³øªíÃþ«¬¡v¦¨¦~³ø¡A¦ý¸ê®Æ¨S¦³§ó·s¡C- Sub getData()
- Dim URL As String, A As Object, B As Object, i As Integer
- URL = "http://stock.finance.sina.com.cn/hkstock/finance/00001.html"
- With CreateObject("InternetExplorer.Application")
- .Visible = True ' ¬O§_Åã¥Ü IE
- .Navigate URL
- Do While .readyState <> 4
- DoEvents
- Loop
- Set A = .document.getelementsbytagname("SELECT")
- A.Item(1).Value = "zero" '¦~³ø
- Cells(1, 1) = .document.body.innerhtml
- .Quit
- End With
- End Sub
½Æ»s¥N½X ¦ý°²¦p§Ú¦b¡uSet A = .document.getelementsbytagname("SELECT")¡v³o¥y¼È°±µ{¦¡¡A¤â°Ê§ó§ï¡u³øªíÃþ«¬¡v¡Aµ²ªG¬O¥i¥H®³¨ì¤K¦~µ²ªG¡C½Ð°Ý¦U¦ì¤j¤j¥i¥H«ü±Ð§Ú¶Ü¡HÁÂÁ¤j®a¡C
¥t¥~¡A§Ú§ä¨ì¤èªk¥i¥H¥Îexcel¤º¸m¥\¯à§â²ÅéÂàÁcÅé¡A¦ý¬O³o¥\¯àn§Ú¥ýÀx¦sWORKBOOK©Î¤â°Ê½T©w¡uÂà´«®É¥¼Àx¦s¡v¡A¬°¤F¯à°÷§å¦¸°õ¦æ¡A©Ò¥H§Ú¥[¤W¤Fthisworkbook.save³o¥y¡A½Ð°Ý°£¤F³o¤èªk¥~¡A¦³¨S¦³¤£¥ÎÀx¦s¡B¤£¥Î½T»{ªºÂà´«¤èªk¡HÁÂÁ¤j®a¡C- Set ConvertObj = Application.COMAddIns("TCSCConv.SharedAddin.14").Object
- thisworkbook.save
- ConvertObj.DoSC2TC
½Æ»s¥N½X |
|