In Spain, you can simply say la cuenta, por favor (the check, please) when you catch your server's attention. Another common phrase many locals use is ¿Nos cobras cuando puedas? (literally Can you charge us when you can?). Either one is a perfectly fine way to ask your server to bring the bill.