I want to buy bus tickets from Seville to Tarifa, and from Tarifa to Malaga. I can find the schedules for the Comes bus service online but have had no luck purchasing tickets. So, I could wait till I get to Seville but, having no experience in traveling in Spain, I don't know how far in advance bus tickets need to be purchased. Anyone with experience with this?
Normally it would not be a problem to wait. There might be exceptional times, such as around holidays when so many people are on the move. I think it's very unlikely you'll have a problem if you buy the tickets when you get to Seville. It would be prudent not to wait until the day of travel if you don't have to.
I was only once affected by a sold-out bus. I was making a transfer between two different bus companies. The transfer point was Bilbao. When I tried to buy a ticket for my second bus, due to leave in 15 or 20 minutes, there were no tickets available. I've also occasionally seen buses for the current day marked as sold out when I was checking out schedules.