This Node.js script is a demonstration of web scraping capabilities using Axios and Cheerio libraries. It showcases the ability to extract product information from the LTT Store website (https://www.lttstore.com/collections/all) by scraping the titles and URLs of products whose URLs start with '/products/'. The extracted data is then displayed using an Express server.
This project was based on the following video tutorial: Web Scraping in Node.js with Axios and Cheerio
- Node.js installed on your machine
- Package.json file with the required dependencies (axios, cheerio, express)
-
Clone the repository or download the script file.
-
Navigate to the project directory.
-
Install the dependencies by running the following command:
npm install
-
Open the script file (
index.js
) and modify thePORT
constant if necessary. -
Run the script using the following command:
node index.js
-
The script will scrape the LTT Store website and log the extracted product titles and URLs to the console.
-
The Express server will start and listen on the specified port.
-
Visit
http://localhost:<PORT>
in your web browser to see the extracted data.
This project serves as a demonstration of the following skills:
- Web scraping using Axios and Cheerio libraries.
- Handling HTTP requests and parsing HTML responses.
- Building a basic Express server to serve the scraped data.
Feel free to explore the code to understand the implementation details.
This project is licensed under the MIT License.
Please note that web scraping may be subject to legal and ethical considerations. Ensure that you have permission to scrape data from targeted websites and comply with their terms of service. Use this script responsibly and at your own risk.