https://github.com/theoddysey/cheerio-scraping
Web scraper using Cheerio and Node-Js ⚒️
https://github.com/theoddysey/cheerio-scraping
cheerio javascript json node-js scraping
Last synced: 2 months ago
JSON representation
Web scraper using Cheerio and Node-Js ⚒️
- Host: GitHub
- URL: https://github.com/theoddysey/cheerio-scraping
- Owner: TheODDYSEY
- Created: 2023-11-26T19:28:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-08T20:47:53.000Z (over 2 years ago)
- Last Synced: 2025-11-07T05:02:22.130Z (8 months ago)
- Topics: cheerio, javascript, json, node-js, scraping
- Language: JavaScript
- Homepage:
- Size: 1.78 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web Scraper using Cheerio and Axios
This project is a simple web scraper implemented in Node.js using Cheerio for HTML parsing and Axios for making HTTP requests. The scraper extracts information about countries and their ISO 3166-1 alpha-3 codes from a Wikipedia page.
## Prerequisites
Before running the scraper, ensure you have Node.js installed on your machine.
## Dependencies
- [axios](https://www.npmjs.com/package/axios): For making HTTP requests.
- [cheerio](https://www.npmjs.com/package/cheerio): For HTML parsing.
- [fs](https://nodejs.org/api/fs.html): For interacting with the file system.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/web-scraper-cheerio-axios.git
```
2. Navigate to the project directory:
```bash
cd web-scraper-cheerio-axios
```
3. Install dependencies:
```bash
npm install
```
## Usage
Run the scraper using the following command:
```bash
node scraper.js
```
The scraper fetches data from the Wikipedia page [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3), extracts information about countries, and saves the data to a file named `countries.json`.
## Project Structure
- `scraper.js`: Main scraper script containing the scraping logic.
- `countries.json`: Output file where scraped data is saved.
## Contributing
Feel free to contribute to the project by opening issues or submitting pull requests.