Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda