- ©«¤l
- 90
- ¥DÃD
- 16
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- sp2
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-9
- ³Ì«áµn¿ý
- 2018-10-7
|
¥»©«³Ì«á¥Ñ white5168 ©ó 2012-5-1 08:37 ½s¿è
ªÑ²¼¦WºÙ¤Î¥N½X¬O¦bºô¶¸ü¤J§¹¦¨«á¡A¤~¥Î JavaScript °ÊºA²£¥Íªº
©Ò¥H Web Query §ì¤£¨ì
¦]¬°ºô¶¸ê®ÆÁÙ³æ¯Â¡A«Øij¥ÎVBA¶}±Òºô¶«á½Æ»sªí®æ¨ìexcel,¦A¿ï¦Û¤vnªº³¡¥÷§Y¥i
Ãö©óªÑ²¼¥N½Xªº³¡¥÷½Ð¦Û¦æקï,
¹ï©ó§ì³o¼Ëªº¸ê®Æ§Ú³£¬O¥Îpython,¦Ó¥B³t«×¤W¤]¤ñVBA§Ö«Ü¦h
PS:¼gµ{¦¡®É½Ð°O±o¥[¤Jµù¸Ñ,¥H¾i¦¨¨}¦nªº¼¶¼g²ßºD,¤]Åý«á±ªº¤H¥i¥H¤è«K¾Ç²ß- Sub Test()
- Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zck/zck_6257.asp.htm"
- Cells.Clear
- Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
- With ie
- .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
- .Navigate url
- Do While .ReadyState <> 4 'µ¥«Ýºô¶¶}±Ò
- DoEvents
- Loop
- .ExecWB 17, 2 'Select All
- .ExecWB 12, 2 'Copy selection
- Sheets("Sheet1").Cells.Select
- Range("A1").Activate
- ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
- False, NoHTMLFormatting:=True
- End With
- Columns("A:B").Delete
- ie.Quit
- MsgBox "¸ê®Æ½Æ»sµ²§ô"
- End Sub
½Æ»s¥N½X ³o¸Ì¤ñ¸û·|¦³°ÝÃD¬Ý¤£À´ªº¦a¤è¤j·§´N¬OExecWB
§Úªþ¤WMSDNªº³sµ²,½Ð¦Û¦æ°Ñ¦Ò http://msdn.microsoft.com/en-us/library/aa752087(v=vs.85).aspx |
|