This project is designed to scrape Pokémon data from Pokémon Database using PHP and the Goutte web scraping library. It extracts various details about each Pokémon, such as Pokedex data, training info, breeding, base stats, and more, and saves this data in JSON format.
- Scrape detailed Pokémon data including stats, abilities, evolution, and sprites.
- Data is saved in a structured JSON format.
- Efficient handling of web requests and data processing.
- PHP 8.3.8 or higher
- Composer for managing dependencies
- Clone the repository:
git clone https://yourrepository.git
cd poke-scrape
-
Install dependencies:
composer install php composer.phar require symfony/browser-kit
-
Run the scraper:
php main.php
To start scraping Pokémon data, simply run the main.php
script from your command line:
php main.php
The script will fetch details for each Pokémon not already present in pokemonData.json
and update this file with new data.
{
"Bulbasaur": {
"vitals": {
"pokedexData": {
"National №": "0001",
"Type": "Grass Poison",
...
},
"training": {...},
"breeding": {...},
"baseStats": {...},
"pokedexEntries": {...},
"whereToFind": {...},
"otherLanguages": {...},
"otherLanguagesSpecies": {...}
},
"typeInteractions": {
"Nor": {...},
"Fir": {...},
...
},
"evolutions": {
"Bulbasaur": {...},
"Ivysaur": {...},
"Venusaur": {...}
},
"sprites": {
"Normal": {...},
"Shiny": {...}
}
}
}
- Vitals: Contains categorized information about the Pokémon, including its Pokedex data, training details, breeding info, base stats, pokedex entries, habitat, and more.
- Type Interactions: Provides details on how this Pokémon's type interacts with other Pokémon types in battles.
- Evolutions: Lists all known evolutions of the Pokémon with links to their sprites and basic data.
- Sprites: Displays the sprites for the Pokémon across different generations and for both normal and shiny appearances.
Contributions to this project are welcome! Please fork the repository and submit a pull request with your features or fixes.
This project is licensed under the MIT License.