The cobra is a somewhat rare animal that spawns around the snake temple in the desert
You can obtain a free cobra egg using a level 7 animal that can fly. Once you get to the island in the background drop down in the hole. Inside, there are a number of gold and ruby nodes. There will also be a cobra egg to collect.