I'm having the same problem! I have found that chewing gum can help but otherwise try to take breaks every now and then to give your mind a break. Online school is difficult but hopefully it won't last very long.
Excercise between breaks has helped me. Its super hard to focus but at least knocking out pushups and situps and pullups helps get the energy out. This year will be pretty sucky, hoping 2021 brings fun back
Doing something with my hands helps me a lot. I like to hold something like a stress ball or a fidget cube. I also learned how to knit in the spring and surprisingly it does a great job keeping me focused.
Being diligent about taking quality notes helps me. Even if they're not notes that I'll actually refer back to, taking them helps me stay engaged and prevents me from wandering to other parts of the internet.