A Node.js project to scrape university rankings data from top1000.com and save it to CSV format.
- Fetches top 1000 universities ranking data
- Extracts university name, city, country, website, and index score
- Exports data to CSV format
- Clean and simple Node.js implementation
npm installRun the scraper:
npm startThe script will:
- Fetch data from the universities ranking website
- Parse the HTML table
- Save the data to
universities.csvin the project directory - Display a preview of the first 5 entries
The generated universities.csv file contains the following columns:
- Rank: Position in the ranking (1-1000)
- University: Name of the university
- City: City where the university is located
- Country: Country where the university is located
- Website: University website URL
- Index: Ranking index score (0-999)
axios: HTTP client for fetching web pagescheerio: HTML parsing and manipulationcsv-writer: CSV file creation
Rank,University,City,Country,Website,Index
1,Harvard University,Cambridge,United States of America,https://...,998
2,Massachusetts Institute of Technology (MIT),Cambridge,United States of America,https://...,997
3,Stanford University,Stanford,United States of America,https://...,995
...
- The scraper includes a User-Agent header to ensure proper access to the website
- If the website structure changes, the selectors in
index.jsmay need to be updated - Please be respectful of the website's resources and avoid excessive requests