UNPKG

gm-review-scraper

Version:

A tool to scrape Google Maps reviews

30 lines (27 loc) 1.17 kB
import { GMRScraper } from "./index.js"; (async () => { const scraper = new GMRScraper({ version: 2, sort_type: "newest", pages: 0, clean: true, key: "xxxx", }); const result = await scraper.scrape( // "https://www.google.com/maps/place/CellphoneS+Th%C3%A0nh+Ph%E1%BB%91+Vinh+-+Ngh%E1%BB%87+An/@18.6738762,105.6764465,15z/data=!4m6!3m5!1s0x3139cf37f28acf5d:0xdb84dbbe3ca1434d!8m2!3d18.6781261!4d105.6742416!16s%2Fg%2F11t5x40vxv?entry=ttu&g_ep=EgoyMDI1MDYxNi4wIKXMDSoASAFQAw%3D%3D", "https://maps.app.goo.gl/tEGNgsKM9FdPDEwL9", ); // const result = await scraper( // "https://www.google.com/maps/place/Wink+Hotel+Saigon+Centre/@10.791263,106.700486,915m/data=!3m2!1e3!4b1!4m9!3m8!1s0x3175299befc9c843:0x61bd46c3c494729e!5m2!4m1!1i2!8m2!3d10.791263!4d106.700486!16s%2Fg%2F11pb7gtkrc?entry=tts&g_ep=EgoyMDI1MTEwMi4wIPu8ASoASAFQAw%3D%3D&skid=27f5669d-09ad-495b-85e3-b2f02acbcef6", // { // sort_type: "newest", // pages: 0, // clean: true, // key: "xxx", // }, // ); console.log(JSON.stringify(result, null, 2)); // result.reviews.map((review) => { // console.log(review); // }); })();