>As long as the infrared LEDs are enabled on your camera, you are going to have problems with attracting bugs, and therefore, the spiders that eat them. Couple that with most cameras being sheltered with handy places to attach a web, and you've got a dandy place for a spider to set up shop.
Repellant: Loop a flea and tick collar around your camera. Attach a drier sheet around the camera.
Fan: Use a fan.
External LED: Example, disable your camera’s internal infrared LED light.
Reduce traction: Use silicon or Teflon spray to cover the body of the camera. Cover the lens with a paper towel before spraying. Or wipe with petroleum jelly.
Source: 24/7 Home Security