VBA:从HTML表中提取日期戳

我试图提取<td>6/19/2017 9:49:14 AM</td>中的日期。 <td>Time extracted</td> allways在同一行OddRow.getElementsByTagName("td")(*).innerText每次都能正常工作吗?VBA:从HTML表中提取日期戳

回答:

这样的事情,我相信。

Sub Scrape_HTML() 

Set ie = CreateObject("InternetExplorer.application")

With ie

.Visible = True

.navigate "your_URL_here"

' Wait for the page to fully load; you can't do anything if the page is not fully loaded

Do While .Busy Or _

.readyState <> 4

DoEvents

Loop

Set Links = ie.document.getElementsByTagName("td")

RowCount = 1

' Scrape out the innertext of each 'td' element.

With Sheets("DataSheet")

For Each lnk In Links

.Range("A" & RowCount) = lnk.innerText

RowCount = RowCount + 1

Next

End With

End Sub

以上是 VBA:从HTML表中提取日期戳 的全部内容, 来源链接: utcz.com/qa/264287.html

回到顶部