Each university has its own rules but most require residency during term-time. Having said that, most will also not mind if you are away for a couple of days with good reason. Some departments take a register at the beginning of each lecture but even if yours doesn't then you should get permission from your lecturers (who may not grant it if they feel the reasons are spurious) if you are going to miss close contact hours (seminars, tutorials).
If you need to be absent for medical or family reasons then you will need to inform your faculty adviser/welfare office who can contact individual lecturers for you.
Academics are human (some even have the paperwork to prove it) but they are also deeply aware of the advanced degree of procrastination attributable to the average student. After all, they were students once and they've had a lot more practice at it than you!