+ Reply to Thread
Results 1 to 4 of 4

Extract Data from SHTML Table

  1. #1
    Registered User
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    96

    Extract Data from SHTML Table

    Hello,

    I am trying to pull data from a table on Baseball Reference and I am unable to get the data to pull. Not sure if this is because the website has a table with a site that ends in .shtml. I have included my workbook and the code below for what I am using. When I try to run the code I can't get any data to generate. Can someone help me out as to why nothing will generate for me? I appreciate the help. Thanks in advance!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Extract Data from SHTML Table

    I tried url from your code
    https://www.baseball-reference.com/boxes/" & ID & ".shtml with ID : SLA/SLA190904140

    https://www.baseball-reference.com/b...90904140.shtml in browser and I got one small table... is that what you want or something more?

    but with https://www.baseball-reference.com/b...03240LAL.shtml - error 404 (first ID from your list)

    maybe check this one: PowerQuery Baseball
    Last edited by sandy666; 04-19-2018 at 05:46 PM.

  3. #3
    Registered User
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    96

    Re: Extract Data from SHTML Table

    I am looking to get the small table to show up as a value within my workbook. I have done this with other sites and able to pull up the data but for some reason I cannot get this table to pull the data within Excel. The second URL that you tried is irrelevant and I removed it to prevent any confusion. Any help so that I can pull this data would be very helpful and appreciated.
    Attached Files Attached Files

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Extract Data from SHTML Table

    you've two IDs there in DV
    one ....40 works but second ....50 doesn't
    you need to check your IDs before put them to the list

    here is example tables from your url for the first ID

    PowerQuery is required to see how it works. There is no any VBA or formula (I didn't touch yours)

    Power Query for

    you post your problem in thread wich is not yours ... my link to there was to show you example file
    Last edited by sandy666; 04-20-2018 at 01:06 AM.

+ 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. Using VBA in Excel macro to extract data from table and reconstruct table
    By pbentonh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2017, 04:03 PM
  2. [SOLVED] vba code to extract data from data table and update data sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-25-2017, 01:23 PM
  3. Extract data from table into new table that matches multiple criteria
    By joplrw10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-25-2016, 12:30 PM
  4. Can't extract data from a table
    By chrisellis250 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2016, 12:44 PM
  5. Extract html table data from specifi table only
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2016, 02:34 PM
  6. Extract data from table
    By etaver87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2016, 10:23 AM
  7. Extract data from a Table
    By RASIKA99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-28-2014, 01:13 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