D
D
dhat2016-08-05 17:33:14
JSON
dhat, 2016-08-05 17:33:14

How to correctly extract data from a table in JSON?

There is a football statistics site, for example https://24score.com/football/italy/serie_a/2014-20...
How to correctly and easily extract the necessary data from tables in JSON?
I tried my small script based on Phantom and Casper, but I manage to rip out only one value from the cell, and if you do a mass collection, then the rest is torn out in a continuous heap, and I can’t figure out how to systematize it into a key-value.
Maybe there are some more or less ready-made solutions? For example, first extract the table, then into JSON, observing the column names. Well, simply, for example, there is a table that has subordinate columns (or I don’t know how to call it correctly). Those. 4 main columns - Team, Total, Houses, Away. In turn, Total, Houses, Guests are divided into 3 more columns each.
Please tell me where to dig at least, direct the thought, because they are already running away.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Timofeev, 2016-08-05
@webinar

To get data in json, you need to find sites that offer this data in the form of json via api

D
dhat, 2016-08-05
@dhat

Well, for example, the task is simpler: I stupidly ripped the html code of the table from the site with my hands. How can I automatically convert this to JSON? I tried some online converter, but it did not separate these main columns, which individually still have 3 columns each.

F
fetis26, 2016-08-05
@fetis26

Write a script that will go through the tables and drive the data into an object, then this object can be in JSON. And you can even connect the script with your hands to the saved page. It is possible on the Node to immediately parse the url. It's not hard.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question