Export data from website
Mostrar comentarios más antiguos
I am trying to export betting odds from the following link: https://www.unibet.eu/betting/sports/filter/football/netherlands/eredivisie/matches
The plan is to export these number (let's say) every hour and then analyse how they change over time. Right now I have the following code with which I have imported the data from this link.
block = urlread('https://www.unibet.eu/betting/sports/filter/football/netherlands/eredivisie/matches');
The problem now is that I do not have the knowledge to extract the relevant data. The relevant data would be:
The teams that are playing, the date and time at which they are playing, the odds that unibet gives.
Does anyone know how to do this and is willing to help me with this problem?
Thank you for reading.
5 comentarios
Rik
el 10 de Mzo. de 2021
Everybody willing to help would have to do the same thing as you: look at the output of the urlread function.
You know where to look on that page for the relevant information. strfind will probably help you out a lot.
You should also note that not every website allows scraping of data.
Lodewijk Pleij
el 10 de Mzo. de 2021
Rik
el 10 de Mzo. de 2021
Then you will have to dig. The information is comming from somewhere. Sometimes you can find the JSON data that the JS is using to create the content. I would suggest investigating the page with your browser debugging tools.
Lodewijk Pleij
el 10 de Mzo. de 2021
That might not be required. Some websites use Javascript to dynamically load data. The backend is usually loaded in JSON format. If you use your browser debugging tools (ctrl+shift+i on Chrome) you might be able to find the direct URL.
My first try turned up a page like this:
If this is indeed the correct URL you only have to find you if you need to update that ncid field.
Respuestas (0)
Categorías
Más información sobre JSON Format en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!