dimitryzub / hotels-scraper-js

Scrape Airbnb, Booking, Hotels.com from a single JavaScript module. ❗No longer maintained.
https://www.npmjs.com/package/hotels-scraper-js
MIT License
16 stars 2 forks source link

node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:258 #6

Open Volodymyr1593 opened 7 months ago

Volodymyr1593 commented 7 months ago

When try to use : hotelsScraper.booking.getHotelInfo();

getting eror:
Puppeteer old Headless deprecation warning: In the near feature headless: true will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passing headless: "new" to puppeteer.launch() If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.

D:.NET\ASP.NET.projekts\MVC\2.Pr(Scraper Data for TravelLink)\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:19:44 at Array.map () at pptr://puppeteer_evaluation_script:18:70 at ExecutionContext._ExecutionContext_evaluate (D:.NET\ASP.NET.projekts\MVC\2.Pr(Scraper Data for TravelLink)\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:.NET\ASP.NET.projekts\MVC\2.Pr(Scraper Data for TravelLink)\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:146:16) at async getHotelInfo (file:///D:/.NET/ASP.NET.projekts/MVC/2.Pr(Scraper%20Data%20for%20TravelLink)/node_modules/hotels-scraper-js/bookingParser/getBookingHotelInfo.js:6:10) at async getBookingHotelInfo (file:///D:/.NET/ASP.NET.projekts/MVC/2.Pr(Scraper%20Data%20for%20TravelLink)/node_modules/hotels-scraper-js/bookingParser/getBookingHotelInfo.js:73:21) at async file:///D:/.NET/ASP.NET.projekts/MVC/2.Pr(Scraper%20Data%20for%20TravelLink)/index.js:5:15

Node.js v18.18.2 PS D:.NET\ASP.NET.projekts\MVC\2.Pr(Scraper Data for TravelLink)>

Browser: Chrome

dimitryzub commented 6 months ago

This package is no longer being maintained.

Most likely it's due to CSS selector change on Hotels.com which doesn't match CSS selector(s) in the parser: Cannot read properties of null (reading 'textContent')

To fix it, you need to change CSS selector(s) in the parser: https://github.com/dimitryzub/hotels-scraper-js/blob/main/hotelsComParser/getHotelsComHotelInfo.js