This project captures a mouse by having a solenoid (electromagnet) drop a bucket over the mouse. The bucket is triggered by the mouse interrupting one of the infrared emitter/detector pairs around the bait. The enclosure that holds the electronics is mounted directly over the bait.
For full details, see:
There is also a short video.