+ Reply to Thread
Results 1 to 2 of 2

Extract html table data from specifi table only

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Extract html table data from specifi table only

    Hi All,

    Using the code below, I am able to populate the website data to excel sheet.
    However, the code will extract the data from all tables (4 in total) and I would only need data from one table only.

    The source code for the intended table:
    table class="basicTable" id="inventoryTable"

    Would it be possible to tweak the code so that it will fetch data from the specific table only?

    Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extract html table data from specifi table only

    I do not see where the code is looping through tables. It is only looping through a single table.
    Set elemCollection = html_inventory.getElementsByTagName("table")
    The default value is table 0.
    If you want from table 2.

    Set elemCollection = html_inventory.getElementsByTagName("table")(1)
    But this is poor guess with out seeing the URL.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA to Import HTML Table Locally Stored HTML file to excel
    By ermengard in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-09-2015, 10:48 AM
  2. Having a problem getting html table data
    By zacherypoche in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-14-2014, 11:54 PM
  3. extract html table to excel sheet
    By joshbcs2 in forum Excel General
    Replies: 0
    Last Post: 07-10-2014, 02:37 AM
  4. Loop Import HTML Tables, Extract 3 Cells from Table, Do Calculation on Cells
    By jhowland in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-04-2013, 01:07 AM
  5. Script loop - get data from html table
    By Rawland Hustle in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-02-2012, 02:32 PM
  6. pull data to HTML from excel table
    By yrndtn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2010, 04:11 PM
  7. pasting data from HTML table
    By bmccall17 in forum Excel General
    Replies: 3
    Last Post: 01-17-2007, 05:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1