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

110
Vistas
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 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