I find the internet endlessly fascinating and distracting from other things. There's just so much information to be gathered! And so much mindless fun!
My suggestion for avoiding it, is to shut off and unplug the computer. If you need to use the computer for schoolwork, then unplug the internet connection, or temporarily disable it. Set a time when you can go back online after you've done some schoolwork, and don't cheat. If you think of something you want to look up, write it down and look it up later (easier said than done, I know). If you need the internet for schoolwork, think about if you really need the internet or if you could go to a library and use books instead. I know it seems faster to find that information on the internet, but is it really faster if you get distracted and spend all your time looking up unrelated things? I think overall, with all the distractions online, it might in fact be faster to go to a library and read books.
Hope that helps. 
_________________
My dream is to one day know what my dream is.
~Michael Novotny