This isn't a minor undertaking.
- Extracting links from HTML and CSS
- Fixing up relative links in files you save.
- Limits on depth and width of spidering.
- Obeying robot exclusion directives
- Throttling download rate and download request rate.
- Download from different servers at the same time
Have you considered using existing tools?