Plug Gaps With Mesh
Stuff in a generous amount of copper mesh with a screwdriver, leaving about half an inch of space for expanding foam sealant. Seal gaps with foam.
Protect Wood From Moisture
Insects and other small pests need to draw life-sustaining moisture from their surroundings, so they avoid dry places and are attracted to moist ones. If the soil around your house, the foundation and the walls is dry, it'll be less attractive to insects, spiders and centipedes. Rake moisture-wicking soil and mulch away from the window frames and low wood. Turn your mulch periodically to help keep dampness down, and keep bushes trimmed back as well.
You can virtually eliminate spiders in your basement by using a dehumidifier to maintain a 40 percent humidity level and vigilantly sweeping down cobwebs whenever they appear. Keep the basement windowsills brushed clean too. In a matter of weeks, the spider population will die down significantly.