PSE Data Scraper is a Python-based tool designed to collect and consolidate historical stock price data from the Philippine Stock Exchange (PSE) EDGE portal.
The script performs the following steps:
- Scrapes a list of all listed companies and their stock symbols from the PSE website.
- Downloads each company's full historical stock price data.
- Saves the data as individual CSV files.
- Merges all files into a single, consolidated CSV file suitable for further analysis.
- Python 3.7 or higher
Install the required dependencies using:
pip install -r requirements.txtTo run the complete data scraping and consolidation process:
python main.pyThis command will:
- Generate
finalstocks.csvcontaining the company and stock symbol list - Save one CSV per company inside the
historicaldata/directory - Produce a unified
combined.csvcontaining all stock data
finalstocks.csv— List of companies and stock symbols from PSEhistoricaldata/— Folder containing historical stock data per companycombined.csv— Single CSV file with all company data combined
pse-data-scraper/
│
├── main.py # Main script to execute the full process
├── requirements.txt # Python package dependencies
├── LICENSE # Project license (MIT)
├── README.md # Project documentation
├── .gitignore # Files and folders excluded from version control
└── utils/
├── scraper.py # Scrapes company and stock symbol data
├── downloader.py # Downloads historical stock prices
└── combiner.py # Combines all CSVs into one
- The script includes polite delays between requests.
- All data is sourced from endpoints provided by the PSE.
This project is licensed under the MIT License. See the LICENSE file for details.