+ Reply to Thread
Results 1 to 3 of 3

Trying to scrape web data into Excel...not working

  1. #1
    Registered User
    Join Date
    05-27-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2016
    Posts
    15

    Trying to scrape web data into Excel...not working

    I'm trying to scrape the query results from this public website into Excel:
    https://www.michigantrafficcrashfact...:70,asc:71,asc

    However, I can't get Excel to recognize the table when I use the 'Data > From Web' tool. Is there some other approach I can take here using Excel's built-in tools?

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Trying to scrape web data into Excel...not working

    Data > From Web tool can be used... but for this site, it's more involved than basic query (see #2 below)

    Since the page uses JQuery to load data after initial page load, you can't scrape data by using page URL alone.

    There are few methods that you can use.

    1. Using VBA pilot IE (browser) to have page load data to container/element. Then scrape data from the loaded page.
    - This method will be slow, but usually is more reliable and easiest method.

    2. Using Developer Tool in browser of your choice. Trace what action sends request that retrieves data. Then replicate that request via VBA, Data > From Web (Advanced) or other means.
    - This is faster method to query. However, will require that you study and deconstruct JQuery request (Request URL, Method, Request Headers needed & Form Data string). It will require significant investment in time/effort up front.

    Sample image of request done on the page:
    0.JPG

    3. If the site has RESTful API. It's probably the best option. But I'm not sure if this site offers one.

    This site/page isn't easy to scape, it may be much easier for you to use "Copy" button available in the page to manually transfer info.
    Last edited by CK76; 07-15-2020 at 11:51 AM. Reason: Spelling
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    05-27-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Trying to scrape web data into Excel...not working

    shoot, okay, that's what i was afraid of. thanks for the tips, tho!

+ 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. scrape with excel vba changing input data before scraping
    By eddirae in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2018, 10:26 AM
  2. Scrape data Using getElementsbyTagName NOT WORKING
    By kazshaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2015, 06:04 AM
  3. [SOLVED] Need VBA code to scrape data into excel from list of websites
    By nadair1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2014, 11:45 AM
  4. Logon daily to website, Scrape data, and paste into Excel 2003 Using VBA
    By Gloopie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2014, 09:25 AM
  5. Scrape Data Using VBA From IE to Excel - Help with code
    By Galleon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2014, 11:00 AM
  6. Scrape, pull or get data from a Website into Excel Please help me out
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2014, 01:42 PM
  7. Having trouble with Excel web query for data scrape
    By stevenab87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2012, 10:18 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