I want to extract data from a website that uses hicharts within its login area.
https://www.highcharts.com/demo/line-basic
I would like to do it without the use of selenium or phantomJS, which both would be overkill but I´m not sure how. In selenium my code would look like this:
data = driver.execute_script('''
values = [];
Highcharts.charts[0].series[0].data.forEach((d) => values.push(d.y));
return values;
''')
If you want to test this in your browsers console use:
values = [];Highcharts.charts[0].series[0].data.forEach(function(d){ values.push(d.y) });console.log(values);
As I understand requests_html has JS support but I was not able to make any progress.
c=session.html.render(script='''values = [];
Highcharts.charts[0].series[0].data.forEach((d) => values.push(d.y));
return values;''')
This gives me an error:
AttributeError: 'HTMLSession' object has no attribute 'html'
Is there another way to achieve this goal?