Laptop is connected but has no internet access

Hello,
When I turn my laptop on I can connect to the internet normally. However, in the middle of browsing suddenly websites stop loading and I check my network connection and it says no internet access, but it says its connected. I am using a modem so when this happens i reconnect it and same thing happens after a few minutes. Is there anyway I can stop this from happening?
