tel est pris qui croyait prendre

Etymology
From the fable  by.

Proverb

 * 1) the biter is bit; the tables are turned; someone was beaten at their own game