-1

I need to scrape the data from this page into a table format. To give you an idea, Here is what it looks like :

Final Table result

I want to see there is a way to bring this data into a table format using VBA script in excel. I can write a VBA code to do this by trimming the information into small pieces and placing it in particular cells.

I believe that's not the most efficient way and something tells me there is probably a better method out there that I just don't know off yet. Hence, I am reaching out here.

I wanted to see if you guys know of a method to do this better than trimming and pasting.

Xiaoy312
  • 14,292
  • 1
  • 32
  • 44
  • @litelite - I dont have a code yet because I am trying to figure out the most efficient method to do this. I am not really looking for a code either, just the method that I should look into to do this. – Shahid Beig May 13 '16 at 18:39
  • The fasted way is to process everything in memory before pasting it to a sheet. So, you want to grab the entire text you got there and place it into a string variable. Then you start building an array and `split` the string into this two-dimensional array. Finally, you place the array on a sheet... Happy coding! – Ralph May 13 '16 at 18:46
  • you may want to take a look at [this](http://stackoverflow.com/questions/36098397/extract-data-from-a-web-page-that-may-not-be-formatted-as-a-table) to give you some ideas, but [this article](http://stackoverflow.com/questions/8798260/html-parsing-of-cricinfo-scorecards?lq=1) is better – Forward Ed May 13 '16 at 18:51
  • @mhyst - Excellent response. Exactly what I was looking for. – Shahid Beig May 13 '16 at 19:20
  • @ForwardEd - Thanks! I get data extraction, but what I am looking for is a bit more challenging due to a pop-up window which is different for each instance. – Shahid Beig May 13 '16 at 19:22
  • @Ralph - Thanks! I'll give that a try if mhyst's information doesn't work! – Shahid Beig May 13 '16 at 19:22
  • Thanks! I hope you know how to put the data into Excel sheet. Here is more information. Look for my answer http://stackoverflow.com/questions/37107574/copy-and-paste-specific-cells-from-one-worksheet-to-another/37172544 – mhyst May 13 '16 at 23:23

1 Answers1

0

The data is in JSON format. You have to parse it and then decide in what way you want to present the data in Excel.

Here it is informacion about that:

Community
  • 1
  • 1
mhyst
  • 297
  • 1
  • 7