Since you mentioned a poetical way, I assume you are thinking of the way we speak of ships as "she". But there is not real convention on sharks (or most animals, really). So I would leave it up to the author which they prefer.
The only poem (or song really) that I can think of with sharks (apart from Baby Shark), is Mack the Knife. This is interesting because it's a translation from German, and there are a few translations.
In one of the most popular translations or The Threepenny Opera (where the song come from), the first line goes:
Oh, the shark has pretty teeth, dear,
And he shows them pearly white
So: "he"
A newer translation goes like this:
See the shark with teeth like razors
All can read his open face
Also: "he"
Bobby Darin recorded Mack The Knife and sang:
Oh, the shark, babe, has such teeth, dear
And it shows them pearly white.
so: "it"
Later, when Ella Fitzgerald covered Bobby Darin's version, she sang:
Oh, the shark has pearly teeth, dear
And he shows them, pearly white
Back to "he"
So at least in Mack the Knife, the shark is almost always a "he".
Hope this helps!