1

I'd like to get data from a chart realized with highcharts. When I access the source code of the website I get a list of elements like this:

d="M 0 136.9393665 L 4.656050955414012 130.131125 L 9.312101910828025 
127.2324005 L 13.968152866242038 129.5386565 L 18.62420382165605 139.5280625 L 23.280254777070063 143.768124 L 27.936305732484076 145.0110095 L 32.59235668789809 143.91938349999998 L 37.2484076433121 143.7456645 L 41.904458598726116 144.66265149999998 L 46.560509554140125 145.5870215 L 51.216560509554135 148.0994725 L 55.87261146496815 149.459911 L 60.52866242038216 151.07021 L 65.18471337579618 153.4142895 L 69.84076433121018 152.76390700000002 L 74.4968152866242 152.325711 L 79.15286624203821 152.2428765 L 83.80891719745223 152.68175100000002

Which I suppose to be the coordinates of each point of the graph. What I'm wondering is the possibility of rescaling this coordinates in order to get the corresponding value of each one. Thanks in advance.

Ludovico Comito
  • 35
  • 1
  • 1
  • 5
  • 1
    Hi @Ludovico Comito, You can get data by global `Highcharts` variable, for example: `Highcharts.charts[0].series[0].userOptions.data`. If you have access only to the SVG elements you would have to get axes scale in some way. – ppotaczek Jun 14 '19 at 11:41
  • can you share the url? I've done something like this in the past – chitown88 Jun 14 '19 at 12:40
  • what language are you scraping with? – QHarr Jun 14 '19 at 15:45
  • I am scraping it with python using Selenium. I am trying to scrape this data from futbin. For example i'd like to get all the values from the daily graph inside the following URL: https://www.futbin.com/19/player/17575/Cristiano%20Ronaldo/ – Ludovico Comito Jun 14 '19 at 18:21
  • By the way, thank you so much for responding. – Ludovico Comito Jun 14 '19 at 18:23
  • Ludovico Comito - For example, y-data is available by: `Highcharts.charts[0].series[0].yData` – ppotaczek Jun 17 '19 at 13:34
  • Hi ppotaczek, thanks for responding. I tried this command inside the Chrome Developer Console and actually works! How can I integrate it inside my Python script? – Ludovico Comito Jun 17 '19 at 20:21
  • Hi @Ludovico Comito, I do not know Python well, but I think that this question: https://stackoverflow.com/questions/7794087/running-javascript-in-selenium-using-python can be useful for you. – ppotaczek Jun 19 '19 at 12:28
  • Thanks ppotaczek, i finally did it! You have been very kind. – Ludovico Comito Jun 21 '19 at 06:21

0 Answers0