Sharks have been spotted at dozens of British beaches over the last five years, with a handful launching attacks on swimmers.