Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!