How do I type a tilde in spanish keyboard?
Using a Spanish keyboard and Spanish keybindings the tilde is altñ. Using English keybindings (System Preferences -> Keyboard -> Input Sources) and a Spanish keyboard it's still altn.
If you immediately enter a / afterwards, you don't need an extra space.

Note: On some keyboards the two alt keys are different. To get the tilde, you may have to use the alt gr key located to the right of the spacebar.