One who traps on Shabbat an animal that is normally hunted, such as a deer or a fish, transgresses a Torah prohibition. Flies, mosquitoes, and fleas are only a rabbinic prohibition. As Maran the Beit Yosef wrote, flies in a closed box are not yet trapped until he takes hold of them. A box with flies may be closed, chickens that left the coop may be pushed back, and a mouse trap may be set, as explained below. From the booklet of Rabbi David Shalom Naki, shlit"a.