A dynamic and scalable data pipeline from Airbnbs commercial site to your local system / cloud storage.
Project description
Airbnb Scraper
A fully dynamic and scalable data pipeline made in Python dedicated to scraping Airbnb's commercial website for both alphanumeric and image data, and saving both locally and/or on the cloud.
Installation
Use the package manager pip to install CommercialScraper.
pip install CommercialScraper
Usage
from CommercialScraper.pipeline import AirbnbScraper
from CommercialScraper.data_save import Save
scraper = AirbnbScraper()
# Returns a dictionary of structured data and a list of image sources for a single product page
product_dict, imgs = scraper.scrape_product_data('https://any/airbnb/product/page', any_ID_you_wish, 'Any Category Label you wish')
# Returns a dataframe of product entries as well as a dictionary of image sources pertaining to each product entry
df, imgs = scraper.scrape_all()
# Initialise an instance of the saver object to save yielded data where you wish
saver = Save(df, imgs)
# Saves the dataframe to a csv in your local directory inside a created 'data/' folder.
# Structured data can be saved in numerous formats, image data can only be saved in .png files
saver.df_to_csv('any_filename')
Docker Image
This package has been containerised in a docker image where it can be run as an application. Please note that data can only be stored onto an SQL database or on the cloud by this method, not in local directories. Docker Image
docker pull docker4ldrich/airbnb-scraper
docker run -it docker4ldrich/airbnb-scraper
Follow the prompts and insert credentials carefully, there won't be a chance to correct any typing errors! It's recommended that you paste credentials in where applicable.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for CommercialScraper-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acbb48a5050d2c861233e072ed3204c8a425a91a2040f210ff53aee69abe8392 |
|
MD5 | 5131071620a16e4ee39ad76ed9411cd2 |
|
BLAKE2b-256 | 385a5c9b41fd34ba4e4eb5025007e6b4f8d951b7345237daf6a56bb5ebc25a44 |