This is a Node.js application that scrapes random names from a website and exposes an API endpoint to retrieve these names.
-
Clone the repository:
git clone https://github.com/SazumiVicky/web-scraping-random-name.git
-
Navigate to the project directory:
cd web-scraping-random-name
-
Install dependencies:
npm install
Start the server
node index.js
-
Once the server is running, you can access the random names by making a GET request to:
http://localhost:3000/get/names/random
-
Example using cURL:
curl http://localhost:3000/get/names/random
[
{
"name_1": {
"First Name": "Clara",
"Last Name": "Middleton"
}
},
{
"name_2": {
"First Name": "Phillip",
"Last Name": "Gutierrez"
}
},
...
]
- express - Web framework for Node.js
- webdriverio - Library for browser automation
- cheerio - Implementation of jQuery for the server-side
Contributions are welcome! Feel free to open an issue or submit a pull request.