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

114
Vistas
Cómo recuperar una variable de un sitio web mientras JavaScript la actualiza

Necesito guardar una variable de un sitio web.

A la izquierda está la página del sitio web donde se indica el valor que debo guardar (peak_ch1), a la derecha está el código html correspondiente.

La variable se define en Javascript con el siguiente código:

 result = ... $('#peak_ch1').val(result);

Con el siguiente código Python:

 import requests from bs4 import BeautifulSoup url= ... #open with GET method resp=requests.get(url) #http_respone 200 means OK status if resp.status_code==200: print("Successfully opened the web page") print("The news are as follow :-\n") # we need a parser,Python built-in HTML parser is enough . soup=BeautifulSoup(resp.text,'html.parser') # l is the list which contains all the text ie news l=soup.find("input",{"id":"peak_ch1"}) print(l) #now we want to print only the text part of the anchor. #find all the elements of a, ie anchor for i in l.findAll("a"): print(i.text) else: print("Error")

Imprime:

 <input class="setfield setfield_info" id="peak_ch1" name="peak_ch1" readonly="" style="margin-top: 5px;" type="text" value="0"/>

Pero necesito el valor que js actualiza. ¿Cómo es posible recuperar el valor?

about 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