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

242
Vistas
Selenium Python: How to fetch text/html data from <script> tag with javascript file from a web page?

The code looks like this:

<script async="" id="__NEXT_PAGE__/restaurants" src="/_next/static/~k5VPZk5KBtLKJOP7fLbR/pages/restaurants.js"></script>

<script async="" id="__NEXT_PAGE__/_app" src="/_next/static/~k5VPZk5KBtLKJOP7fLbR/pages/_app.js"></script>

<script async="" src="/_next/static/chunks/146.5cc25d7743407960833f.js"></script>

<script src="/_next/static/runtime/webpack-562f11f96da3918c3d37.js" async=""></script>

<script src="/_next/static/chunks/styles.4fc2149595e9293ccd52.js" async=""></script>

<script src="/_next/static/chunks/styles.4fc2149595e9293ccd52.js" async=""></script>

I used

webdriver.Chrome().find_element_by_id("NEXT_PAGE/restaurants").get_attribute("innerHtml") and

webdriver.Chrome().find_element_by_xpath("//script[@src='/_next/static/chunks/136.ff85cd2297a8e5bf9619.js']").get_attribute("innerHtml")

but they returned None.

I am not really sure if there is text inside the tag btw. This is the page: https://food.grab.com/ph/en/restaurants

I am trying to fetch latitude and longitude for restaurants on the pages after pressing 'load more' button. This info is available in tag with id = 'NEXT_DATA' for first 16 restaurants but beyond that it seems to be hidden somewhere. I know python but not javascript.

about 4 years ago · Juan Pablo Isaza
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