|
感谢apollokk老师指导,又修改了下代码,代码如下:- Option Explicit
- Sub a()
- Dim ie1 As Object, t As Single, url As String
- UserForm1.WebBrowser1.Silent = True
- On Error Resume Next
- 'Load UserForm1
- 'UserForm1.Show 0
- [a1].CurrentRegion.Clear
- Cells.NumberFormat = "@"
- Set ie1 = UserForm1.WebBrowser1
- With ie1
- .Navigate "http://www.go24k.com/" '网址
- t = Timer
- Do Until InStr(.Document.body.innertext, "上金所") > 0
- DoEvents
- Loop
-
- url = "http://quote.go24k.com:8080/showshxhhq.asp"
- .Document.body.innerHTML = "<a href='" & url & "'>ffffff</a>"
- .Document.all.tags("a")(0).Click
- t = Timer
- Do Until InStr(.Document.body.innertext, "Ag(T+D)") > 0
- DoEvents
- Loop
- .Document.body.Focus
- .Document.execCommand "SelectAll"
- .Document.execCommand "copy"
- End With
- Range("A1").Select
- ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
- Rows(1).Delete Shift:=xlUp
- Set ie1 = Nothing
- End Sub
复制代码 |
|