To get the unit prices sqm, I would have to mouseover each unit number. This script uses the web automation tool, Selenium, to mouseover each unit number and capture the each unit price and sqm, giving me a .csv
.
Currently, the script only works for Toa Payoh Bidadari Parkview, but I believe if the structure of HDB web page is similar, it can be generalized to other projects as well.
- Download selenium's chrome driver.
- Create conda environment
conda env create -f env.yml
edit config in. The new code has deprecatedconfig.toml
config.toml
Change the arguments in the.scrape
method ofHDBScraper
- change path to chrome driver in
utils.py
- Run script
conda activate hdb_scraper
python scrape.py
- The script will sometimes fail when selenium controlled broswer is not big enough or have not loaded the tables.