Real Estate Scrape
==================
This solution collects central-Kentucky real-estate listings from:
https://www.thwaitesrealtors.com/
The console scraper discovers every result page for the selected counties, parses
property details, and stores them in a SQLite database. The MVC application searches
that local database by county, price, square footage, and lot size.
Projects
--------
- Scraper: console application and Thwaites HTML parser.
- RES.DAL: Entity Framework Core context, entity, and migrations.
- RealEstateScrapeMVC: search user interface.
- RES.Tests: deterministic parser, pagination, migration, validation, and repository tests.
Setup
-----
1. Install the .NET 8 SDK.
2. From this directory, run:
dotnet restore RealEstateScrapeMVC.sln
dotnet test RealEstateScrapeMVC.sln
3. Run the scraper:
dotnet run --project Scraper
4. Run the search site:
dotnet run --project RealEstateScrapeMVC
The SQLite database is stored as PropertyData.db in the current user's local
application-data directory. Database migrations are applied automatically when either
application starts. Re-running the scraper updates existing rows by canonical listing
URL instead of creating duplicates.
Set the PROPERTY_DB_PATH environment variable to use a different SQLite file. Use the
same value when running the scraper and MVC application.
Operational notes
-----------------
- The scraper sends a browser user-agent and referrer because the target site requires them.
- Requests are throttled and transient HTTP failures are retried.
- A malformed listing is logged and skipped without terminating the full scrape.
- Press Ctrl+C to cancel safely.
- Review the target site's terms and robots policy before scheduling unattended runs.