Pulling a table out of a mess of HTML w/ VBA & Excel

前端 未结 1 1145
渐次进展
渐次进展 2020-12-22 02:16
\'get the table based on the table’s id
Set ieDoc = ieApp.Document
Set ieTable = ieDoc.all.Item(\"contentBody\")

\'copy the tables html to the clipboard and paste t         


        
相关标签:
1条回答
  • 2020-12-22 02:41

    Basically you can get items by tag name., like described in this link: http://www.vbaexpress.com/forum/showthread.php?t=31831

    Dim HTMLdoc As HTMLDocument
    Dim TDelements As IHTMLElementCollection   
    
    Set HTMLdoc = ieApp.Document
    Set TDelements = HTMLdoc.getElementsByTagName("table")
    

    And if you want, you can enumerate through the items:

    Dim TDelement As HTMLTableCell
    For Each TDelement In TDelements
        'code-code-code-code-code
    Next
    
    0 讨论(0)
提交回复
热议问题