Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
Is there a way to send JavaScript queries with python without a (headless) browser?

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?

almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!