Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@stayko/airbnb-scraper
Advanced tools
Scapes AirBnb listing pages
Requires Node V10+ for 'fs' promises
npm install @stayko/airbnb-scraper
import Scraper from '@stayko/airbnb-scraper';
const scraper = new Scraper("https://www.airbnb.com/rooms/28299515?location=London%2C%20United%20Kingdom&adults=1&toddlers=0&guests=1&check_in=2019-04-26&check_out=2019-04-30&s=-xq9rVl0")
//Promise
scraper.scrapeHTML().then(result => console.log(result));
//async await
const result = await scraper.scrapeHTML();
/*
Example result:
{
title: 'HS4-5 Premium Location in Heart of Brick Lane!',
location: 'Greater London',
description:
[
'Private room in apartment2 guests1 bedroom1 bed2 shared baths',
'Sparkling clean · 9 recent guests“Arturs flat is nice, clean and tidy.”',
'Self check-inCheck yourself in with the keypad.',
'Great check-in experience95% of recent guests gave the check-in process a 5-star rating.',
],
amenities:
[
'Wireless Internet',
'Kitchen',
'Dryer',
'Laptop friendly workspace'
],
images:
[
'https://a0.muscache.com/im/pictures/dbca3c9b-1ec6-4a6d-bfe6-66acfc51ec5d.jpg?aki_policy=xx_large',
'https://a0.muscache.com/im/pictures/4921db74-ab6b-4da7-b504-12ea3139b3f2.jpg?aki_policy=large',
'https://a0.muscache.com/im/pictures/78556ddc-8183-48ea-9e72-8bb9567ef5ca.jpg?aki_policy=large',
'https://a0.muscache.com/im/pictures/96a10fc5-b280-41f0-b6b1-8f692e72b8a6.jpg?aki_policy=large',
'https://a0.muscache.com/im/pictures/f2697a94-ded8-42cd-8136-f49e37a9666c.jpg?aki_policy=large'
]
}
/*
//default selector rules for scraping different elements of the page
{
title: "#room #summary h1 > span",
location: "div[data-location] > a > div",
description: "#summary + div > div > div > div",
amenities: "#room #amenities td > div",
images: "#room meta[itemprop=image] + div div > img:nth-child(2)"
}
//they can be overriden via the constructor or setSelectors method
const newSelectorsObj = {title: "new selector rule for title"};
const scraper = new Scraper(url, newSelectorsObj);
scraper.setSelectors(newSelectorsObj);
import Scraper from '@stayko/airbnb-scraper';
const scraper = new Scraper("https://www.airbnb.com/rooms/28299515?location=London%2C%20United%20Kingdom&adults=1&toddlers=0&guests=1&check_in=2019-04-26&check_out=2019-04-30&s=-xq9rVl0")
const result = await scraper.scrapeHTML();
Scraper.saveImagesToDisk(result.images, '/saved/images'); //saves all images to specified directory
Scraper.saveTextToDisk(result.title, '/saved/file.txt'); //saves scraped text to specified text file
FAQs
AirBnb scraper
The npm package @stayko/airbnb-scraper receives a total of 0 weekly downloads. As such, @stayko/airbnb-scraper popularity was classified as not popular.
We found that @stayko/airbnb-scraper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.