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

116
Visualizações
How to use Puppeteer for getting lattitude and longitude of restaurants

I want to scrape the data from the following website:- https://food.grab.com/sg/en/

These are the steps I want to implement

  1. Type "Singapore" (or any location in Singapore) in the input box.
  2. Click on the search button.
  3. Click on the load more button until it is not disabled or disappeared. (This will load all the restaurants related to "Singapore")
  4. Click on each restaurant.
  5. Get the lat lang data from network tab
  6. click back

Following is my code:

const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch({ headless: false });
  const page = await browser.newPage();
  await page.goto("https://food.grab.com/sg/en/");
  await page.type("input", "Singapore");
  await page.click(".submitBtn___2roqB");
  //click on load_more while it is not disabled


  //click on every restaurant
  //get the lat lang data from network tab
  //go back

  const elHandleArr = await page.$$(".realImage___2TyNE show___3oA6B");
  let arr = [];

  elHandleArr.map(async (el) => {
    await el.evaluate((b) => b.click());
    page.on("request", (req) => {
      console.log(req.headers());
      arr.push(req.headers());
    });
    await page.goBack();
    page.waitFor(1000);
  });

  console.log(arr);

  // await browser.close();
})();

So I am able to perform the first two steps but not able to click on the load more button and not able to click on restaurants.

about 4 years ago · Santiago Gelvez
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