|
- Sub 东方财富_货币型基金每日收益一览表()
- Dim html As Object, arr, db, Tr, Td, i, j
- Dim arrData(1 To 10000, 1 To 11)
- Set html = CreateObject("htmlfile")
- With CreateObject("msxml2.xmlhttp")
- .Open "GET", "http://fund.eastmoney.com/HBJJ_dwsy.html", False
- .send
- html.write StrConv(.Responsebody, vbUnicode)
- End With
- Set db = html.all.tags("table")("oTable")
- Cells.Clear
- For Each Tr In db.Rows
- i = i + 1
- j = 0
- For Each Td In Tr.Cells
- j = j + 1
- If i > 2 And j > 3 Then arrData(i - 2, j - 3) = Td.innerText '从第三行,第三列开始取数据
- Next
- Next
- ActiveSheet.[a1].Resize(i - 3, j - 2) = arrData
- End Sub
复制代码
东方财富现在货币基金是第4列才有基金代码,这样改测试不过,不知道哪里问题 |
|