Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't scrap Hotels.com #5

Open
juseoljae opened this issue Sep 13, 2023 · 3 comments
Open

I can't scrap Hotels.com #5

juseoljae opened this issue Sep 13, 2023 · 3 comments

Comments

@juseoljae
Copy link

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?

@QuentinSc
Copy link

The package need an update, same for airbnb :/

@Sv-Shok
Copy link

Sv-Shok commented Jan 28, 2024

Could you tell me what exactly needs to be updated?

@dimitryzub
Copy link
Owner

dimitryzub commented Feb 13, 2024

Hey guys, this package is no longer being maintained.

Regarding the issue both with Hotels.com and Airbnb. Most likely it's due to CSS selector change.

In other words, CSS selector on the website doesn't match CSS selector in the parser and thus it can't get anything from the website Cannot read properties of null (reading 'textContent')

For Hotels, it's here:

If it's the case, you need to change CSS selectors in the parser.

Or it could be something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants