We can also assume that since the spider's speed will be lower, the ant needs to be cornered or kept near a corner. Find a point from which you can catch the ant regardless of one of the three directions it can choose, taking into account the possibility that it can stand still until the very end.
Added after 13 hours and 52 minutes
Hint.
Solve the riddle! An ant runs along the sides of an equilateral triangle at a speed of v, and a spider runs across its entire area. What should be the minimum speed u of the spider so that it can catch it?
How do you like my hint? :)