How do you keep bees from collecting in or on the containers while draining the hive?

How do you keep bees from collecting in or on the containers while draining the hive?

Welcome to the forum, Edward.
There’s a number of methods used and described in the forum you could search for. In short, connect a short length of clear flexible hose to the Flow tube and direct the other end into the container through a hole in the lid cut slightly larger than the hose. This keeps the bees out while allowing air out.
Alternatively, you can drape a light cloth over everything, though this is fiddle in practice.
Some have made up a full on manifold system directed into a 5gal pail through a hole in the lid. I prefer individual frames drain into separate containers to preserve the unique flavours each frame often has.
Once you’ve setup your preferred method, you’ll enjoy harvesting honey much more.
Cheers,
Mike

You can harvest at nighttime too, when the bees aren’t flying.

Also if you use a cloth to cover, rather than mesh, consider wetting it so it is damp. I also find it useful to use cloths pegs to hold the cloth in place