Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda