Hi
You can drive an English registered car for a max of 6 months in Spain, and make sure you have proof of how long you have been in the country, perhaps your flight or ferry confirmations. Of course it will depend on the time your English insurance company allows you to drive abroad and if the road tax or MOT is due to expire. It may be only three months.
Depending on whether you want to save money or a little hassle, you have two choices. If you buy a RHD Spanish registered car in England and it has supposedly got its documents, there is still one more hurdle when you get here. In Catalonia and I assume the rest of Spain the seller has to go to the traffic office to sign to say he/she has sold it to you. Also you have to take the documents to the traffic office to transfer ownership unlike in the UK where you can do it by post or after October on line. Someone else may be able to clarify but you may have to both go at the same time to the same office. We did when transferring ownership, but don't know If that is compulsory or not. So, that would be a problem if the car is bought in the UK and the seller is there as well. With this in mind it may be just as easy to buy the car in Spain. If you buy it from a dealer the dealer will sort this all out.  If you buy privately make sure it is within the nearest traffic office area.
The other option is to buy either a left or right hand drive UK registered car, drive it to Spain then prior to the UK insurance/MOT/tax etc. expiring, get the car matriculated. This is basically registering the car for Spanish plates. It can be complicated but look on line for English speaking matriculation companies in Spain and for a fee they will do it all for you. You will need the equivalent of an MOT, and emissions test which is separate here. You will have to pay import tax and transfer fee. The import tax is based on the value of the car and cars are more expensive in Spain so certainly will not be less than the value in the UK. Depending on the age and value, it could cost up to three or four thousand pounds. So I would certainly advise getting a Spanish registered car whether you choose to buy it in Spain or in England.
Sorry this is a bit long winded but the best way to carry out these sort of things without getting in to trouble is to get advise before you do the wrong thing. All this advice is from experience. We bought a vehicle out her years ago when we only came for holidays, but then missed the deadline for matriculating it. We just use it on our land now as a tractor, as we discovered that to matriculate it would have cost more than it was worth, and to have it taken back to England on a trailer would again have also cost more than it is worth. We ended up buying a Spanish car.