My grandfather used to have a bird feeder on a metal pole and squirrels would climb the pole to eat the food. He attached electrical wire to the pole and connected it to switch. Flipped the switch whenever he saw a squirrel climbing up. Didn’t get all of them but he had fun trying!