You need line of sight without obstructions to the target to be able to hit it.

You might need to move around until you have a straight line to hit it from, or wait for the spider to move into range.

If none of that works it might simply be stuck.