Code Monkey home page Code Monkey logo

hotels-scraper-js's Issues

[feature] add CLI

Currently, we can access data by writing actual code.

Some of the users might want to just use CLI for quick data extraction or something else without writing code.

hotels-scraper get airbnb, booking --location Madrid --checkin <date> --checkout <date> ...

I can't scrap Hotels.com

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?

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.