first, I did below
npm i hotels-scraper-js
then, GetHotelsCom.js is very simple
import { hotelsCom, saveToJSON } from "hotels-scraper-js";
hotelsCom.getHotels().then(saveToJSON);
then,
node GetHotelsCom.js
it occurs error
D:\Web\hotelsScrap\hotels-scraper-js-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:258
throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
^
Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'textContent')
at pptr://puppeteer_evaluation_script:7:38
at Array.map ()
at pptr://puppeteer_evaluation_script:2:121
at ExecutionContext._ExecutionContext_evaluate (D:\Web\hotelsScrap\hotels-scraper-js-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:258:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (D:\Web\hotelsScrap\hotels-scraper-js-main\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:146:16)
at async getHotelsInfo (file:///D:/Web/hotelsScrap/hotels-scraper-js-main/node_modules/hotels-scraper-js/hotelsComParser/getHotelsComHotels.js:39:10)
at async getHotelsComHotels (file:///D:/Web/hotelsScrap/hotels-scraper-js-main/node_modules/hotels-scraper-js/hotelsComParser/getHotelsComHotels.js:361:19)
Node.js v18.17.1
can you help me?